diff --git a/config/config.go b/config/config.go index 2dee2b73..9aa4021d 100644 --- a/config/config.go +++ b/config/config.go @@ -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() diff --git a/config/types.go b/config/types.go index 64c7bb95..3d144264 100644 --- a/config/types.go +++ b/config/types.go @@ -67,6 +67,11 @@ var ( "rancher.docker.server_key", "rancher.docker.server_cert", } + Additional = []string{ + "rancher.password", + "rancher.autologin", + "EXTRA_CMDLINE", + } ) func init() {