mirror of
https://github.com/rancher/os.git
synced 2025-06-24 05:57:03 +00:00
19 lines
345 B
Go
19 lines
345 B
Go
package config
|
|
|
|
func NewConfig() *CloudConfig {
|
|
return ReadConfig(nil, OsConfigFile)
|
|
}
|
|
|
|
func ReadConfig(bytes []byte, files ...string) *CloudConfig {
|
|
if data, err := readConfig(bytes, files...); err == nil {
|
|
c := &CloudConfig{}
|
|
if err := c.merge(data); err != nil {
|
|
return nil
|
|
}
|
|
c.amendNils()
|
|
return c
|
|
} else {
|
|
return nil
|
|
}
|
|
}
|