module GClouder::Resources::Container::Clusters::Config

Public Class Methods

merged(config) click to toggle source
# 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