Sha256: 92be50846a81b873707f0ac85bdc88bf2da3a44c9e2755858db338415e4a4ec7

Contents?: true

Size: 569 Bytes

Versions: 5

Compression:

Stored size: 569 Bytes

Contents

# typed: true

require 'base64'
require 'kube-dsl'

module Kuby
  module Kubernetes
    class DockerConfig
      extend ::KubeDSL::ValueFields

      value_fields :registry_host, :username, :password, :email

      def initialize(&block)
        instance_eval(&block) if block
      end

      def serialize
        {
          registry_host.to_sym => {
            username: username,
            password: password,
            email:    email,
            auth:     Base64.strict_encode64("#{username}:#{password}")
          }
        }
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
kuby-core-0.20.2 lib/kuby/kubernetes/docker_config.rb
kuby-core-0.20.1 lib/kuby/kubernetes/docker_config.rb
kuby-core-0.20.0 lib/kuby/kubernetes/docker_config.rb
kuby-core-0.19.0 lib/kuby/kubernetes/docker_config.rb
kuby-core-0.18.0 lib/kuby/kubernetes/docker_config.rb