Class: Kuby::Kubernetes::RegistrySecret

Inherits:
KubeDSL::DSL::V1::Secret
  • Object
show all
Defined in:
lib/kuby/kubernetes/registry_secret.rb

Instance Method Summary collapse

Constructor Details

#initialize(&block) ⇒ RegistrySecret

Returns a new instance of RegistrySecret.



9
10
11
# File 'lib/kuby/kubernetes/registry_secret.rb', line 9

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

Instance Method Details

#serializeObject



13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/kuby/kubernetes/registry_secret.rb', line 13

def serialize
  super.tap do |result|
    result[:type] = 'kubernetes.io/dockerconfigjson'
    result[:data] = {
      :".dockerconfigjson" => Base64.strict_encode64({
        auths: docker_configs.each_with_object({}) do |dc, ret|
          ret.merge!(dc.serialize)
        end
      }.to_json)
    }
  end
end