From 356fe006a2b10b1b9cbaab6e1088d72d3e37e0a1 Mon Sep 17 00:00:00 2001 From: galal-hussein Date: Thu, 12 Mar 2020 20:18:56 +0200 Subject: [PATCH] Add asterisks for omitted values in nodeconfig --- pkg/nodeconfig/nodeconfig.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/nodeconfig/nodeconfig.go b/pkg/nodeconfig/nodeconfig.go index f4b118ed42..77946f3d44 100644 --- a/pkg/nodeconfig/nodeconfig.go +++ b/pkg/nodeconfig/nodeconfig.go @@ -16,6 +16,7 @@ const ( NodeArgsAnnotation = "k3s.io/node-args" NodeEnvAnnotation = "k3s.io/node-env" NodeConfigHashAnnotation = "k3s.io/node-config-hash" + OmittedValue = "********" ) func getNodeArgs() (string, error) { @@ -31,7 +32,7 @@ func getNodeArgs() (string, error) { for i, arg := range nodeArgsList { if isSecret(arg) { if i+1 < len(nodeArgsList) { - nodeArgsList[i+1] = "" + nodeArgsList[i+1] = OmittedValue } } } @@ -52,7 +53,7 @@ func getNodeEnv() (string, error) { } for key := range k3sEnv { if isSecret(key) { - k3sEnv[key] = "" + k3sEnv[key] = OmittedValue } } k3sEnvJSON, err := json.Marshal(k3sEnv)