Module: GClouder::Resources::Container::Clusters::Cluster
- Includes:
- Config::CLIArgs, GCloud, Helpers, Logging, Shell
- Defined in:
- lib/gclouder/resources/container/clusters.rb
Class Method Summary collapse
- .build(region, cluster) ⇒ Object
- .create(cluster_name, config) ⇒ Object
-
.loop_until_cluster_exists(cluster_name) ⇒ Object
def self.check_values(key, remote_value, local_value) if remote_value != local_value fatal “error: remote config doesn’t match local config: #key (#remote_value != #local_value)” else #debug “local and remote keys have same value for param: #key = #local_value” true end end.
Methods included from GCloud
Methods included from Config::CLIArgs
check, #cli_args, cli_args, included, load, valid_resources
Methods included from Config::Project
Methods included from Helpers
#hash_to_args, included, #module_exists?, #to_arg, #to_deep_merge_hash, #valid_json?
Methods included from Logging
#add, #bad, #change, #debug, #error, #fatal, #good, included, #info, log, loggers, #remove, report, #resource_state, setup, #warn, #warning
Methods included from Shell
Class Method Details
.build(region, cluster) ⇒ Object
125 126 127 128 129 130 131 132 133 134 135 136 |
# File 'lib/gclouder/resources/container/clusters.rb', line 125 def self.build(region, cluster) unless cluster["zone"] info "skipping cluster since no zone is set" return end config = cluster.context(:create_cluster) create(cluster["name"], config) #check_immutable_conflicts(cluster) end |
.create(cluster_name, config) ⇒ Object
248 249 250 251 252 |
# File 'lib/gclouder/resources/container/clusters.rb', line 248 def self.create(cluster_name, config) args = hash_to_args(config) Resource.ensure :"container clusters", cluster_name, args, indent: 3 loop_until_cluster_exists(cluster_name) if !cli_args[:dry_run] end |
.loop_until_cluster_exists(cluster_name) ⇒ Object
def self.check_values(key, remote_value, local_value)
if remote_value != local_value
fatal "error: remote config doesn't match local config: #{key} (#{remote_value} != #{local_value})"
else
#debug "local and remote keys have same value for param: #{key} = #{local_value}"
true
end
end
242 243 244 245 246 |
# File 'lib/gclouder/resources/container/clusters.rb', line 242 def self.loop_until_cluster_exists(cluster_name) until Resource.resource?("container clusters", cluster_name, silent: true) sleep 1 end end |