Module: GClouder::Resources::Container::Clusters::Config

Defined in:
lib/gclouder/resources/container/clusters.rb

Class Method Summary collapse

Class Method Details

.merged(config) ⇒ Object



43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/gclouder/resources/container/clusters.rb', line 43

def self.merged(config)
  return unless config.key?("regions")
  config["regions"].each do |region, region_config|
    next unless region_config.key?("clusters")

    region_config["clusters"].each_with_index do |cluster, cluster_index|
      cluster_config = config["regions"][region]["clusters"][cluster_index]
      config["regions"][region]["clusters"][cluster_index] = GClouder::Config::Cluster.new(cluster_config)

      config["regions"][region]["clusters"][cluster_index]["node_pools"].each_with_index do |pool, pool_index|
        pool_config = config["regions"][region]["clusters"][cluster_index]["node_pools"][pool_index]
        config["regions"][region]["clusters"][cluster_index]["node_pools"][pool_index] = GClouder::Config::Cluster.new(pool_config)
      end
    end
  end

  config
end