Documentation ¶
Overview ¶
Package configcollector can be used to merge configuration from different sources into one YAML.
Index ¶
Constants ¶
const DefaultHeader = "#cloud-config"
Variables ¶
var MergeBootLine = func(o *Options) error { o.MergeBootCMDLine = true return nil }
var ValidFileHeaders = []string{
"#cloud-config",
"#kairos-config",
"#node-config",
}
Functions ¶
func DeepMerge ¶ added in v2.0.3
func DeepMerge(a, b interface{}) (interface{}, error)
DeepMerge takes two data structures and merges them together deeply. The results can vary depending on how the arguments are passed since structure B will always overwrite what's on A.
func HasValidHeader ¶
Types ¶
type Config ¶
type Config map[string]interface{}
We don't allow yamls that are plain arrays because is has no use in Kairos and there is no way to merge an array yaml with a "map" yaml.
func ParseCmdLine ¶
ParseCmdLine reads options from the kernel cmdline and returns the equivalent Config.
func (Config) ConfigURL ¶
ConfigURL returns the value of config_url if set or empty string otherwise.
func (*Config) MergeConfig ¶
MergeConfig merges the config passed as parameter back to the receiver Config.
func (*Config) MergeConfigURL ¶
MergeConfigURL looks for the "config_url" key and if it's found it downloads the remote config and merges it with the current one. If the remote config also has config_url defined, it is also fetched recursively until a remote config no longer defines a config_url. NOTE: The "config_url" value of the final result is the value of the last config file in the chain because we replace values when we merge.