Commit 99ba3577 authored by Lucas Nussbaum's avatar Lucas Nussbaum
Browse files

[dev] add 'defaults' section in kadeploy generator

parent 18d5c069
......@@ -180,7 +180,13 @@ end
conf = YAML::load("#{options[:conf_dir]}/kadeployg5k#{suffix}.yaml")).result(binding))
site['clusters'].each { |cluster_uid, cluster|
data = data = conf[site_uid][cluster_uid]
defaults = conf['defaults']
overrides = conf[site_uid][cluster_uid]
dupes = (defaults.to_a & overrides.to_a)
if not dupes.empty?
puts "Warning: cluster-specific configuration for #{cluster_uid} overrides default values: #{dupes.to_s}"
data = data = defaults.merge(overrides)
if data.nil?
puts "Warning: configuration not found in #{options[:conf_dir]}/kadeployg5k#{suffix}.yaml for #{cluster_uid}. Skipped"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment