mirror of
https://github.com/rancher/os.git
synced 2025-04-28 11:24:26 +00:00
Add export filter of additional property
This commit is contained in:
parent
41a3330d89
commit
a9eb57759c
@ -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()
|
||||
|
||||
|
@ -67,6 +67,11 @@ var (
|
||||
"rancher.docker.server_key",
|
||||
"rancher.docker.server_cert",
|
||||
}
|
||||
Additional = []string{
|
||||
"rancher.password",
|
||||
"rancher.autologin",
|
||||
"EXTRA_CMDLINE",
|
||||
}
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
Loading…
Reference in New Issue
Block a user