Class: KubeDeployTools::ArtifactRegistry

Inherits:
Object
  • Object
show all
Defined in:
lib/kube_deploy_tools/artifact_registry.rb,
lib/kube_deploy_tools/artifact_registry/driver.rb,
lib/kube_deploy_tools/artifact_registry/driver_base.rb

Overview

Read-only model for artifact_registries[] array element in KDT deploy.yaml configuration file.

Defined Under Namespace

Modules: Driver

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(h) ⇒ ArtifactRegistry

Returns a new instance of ArtifactRegistry.



10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/kube_deploy_tools/artifact_registry.rb', line 10

def initialize(h)
  @name = h['name']
  @driver_name = h['driver']
  @config = h['config']

  if !ArtifactRegistry::Driver::MAPPINGS.key?(@driver_name)
    Logger.warn("Unsupported .artifact_registries.driver: #{@driver_name}")
  else
    @driver = ArtifactRegistry::Driver::MAPPINGS
      .fetch(@driver_name)
      .new(config: @config)
  end
end

Instance Attribute Details

#configObject

Returns the value of attribute config.



8
9
10
# File 'lib/kube_deploy_tools/artifact_registry.rb', line 8

def config
  @config
end

#driverObject

Returns the value of attribute driver.



8
9
10
# File 'lib/kube_deploy_tools/artifact_registry.rb', line 8

def driver
  @driver
end

#driver_nameObject

Returns the value of attribute driver_name.



8
9
10
# File 'lib/kube_deploy_tools/artifact_registry.rb', line 8

def driver_name
  @driver_name
end

#nameObject

Returns the value of attribute name.



8
9
10
# File 'lib/kube_deploy_tools/artifact_registry.rb', line 8

def name
  @name
end

Instance Method Details

#==(o) ⇒ Object



24
25
26
27
28
# File 'lib/kube_deploy_tools/artifact_registry.rb', line 24

def ==(o)
  @name == o.name
  @driver == o.driver
  @config == o.config
end