mirror of
https://github.com/rancher/os.git
synced 2025-09-01 06:40:31 +00:00
Add export filter of additional property
This commit is contained in:
@@ -35,6 +35,7 @@ func Merge(bytes []byte) error {
|
||||
|
||||
func Export(private, full bool) (string, error) {
|
||||
rawCfg := loadRawConfig("", full)
|
||||
rawCfg = filterAdditional(rawCfg)
|
||||
if !private {
|
||||
rawCfg = filterPrivateKeys(rawCfg)
|
||||
}
|
||||
@@ -50,6 +51,14 @@ func filterPrivateKeys(data map[interface{}]interface{}) map[interface{}]interfa
|
||||
return data
|
||||
}
|
||||
|
||||
func filterAdditional(data map[interface{}]interface{}) map[interface{}]interface{} {
|
||||
for _, additional := range Additional {
|
||||
_, data = filterKey(data, strings.Split(additional, "."))
|
||||
}
|
||||
|
||||
return data
|
||||
}
|
||||
|
||||
func Get(key string) (interface{}, error) {
|
||||
cfg := LoadConfig()
|
||||
|
||||
|
Reference in New Issue
Block a user