Browse Source

Merge pull request #1525 from galal-hussein/add_asterisk

Add asterisks for omitted values in nodeconfig
pull/1453/head^2
Craig Jellick 5 years ago committed by GitHub
parent
commit
65f7fbe5c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      pkg/nodeconfig/nodeconfig.go

5
pkg/nodeconfig/nodeconfig.go

@ -16,6 +16,7 @@ const (
NodeArgsAnnotation = "k3s.io/node-args" NodeArgsAnnotation = "k3s.io/node-args"
NodeEnvAnnotation = "k3s.io/node-env" NodeEnvAnnotation = "k3s.io/node-env"
NodeConfigHashAnnotation = "k3s.io/node-config-hash" NodeConfigHashAnnotation = "k3s.io/node-config-hash"
OmittedValue = "********"
) )
func getNodeArgs() (string, error) { func getNodeArgs() (string, error) {
@ -31,7 +32,7 @@ func getNodeArgs() (string, error) {
for i, arg := range nodeArgsList { for i, arg := range nodeArgsList {
if isSecret(arg) { if isSecret(arg) {
if i+1 < len(nodeArgsList) { if i+1 < len(nodeArgsList) {
nodeArgsList[i+1] = "" nodeArgsList[i+1] = OmittedValue
} }
} }
} }
@ -52,7 +53,7 @@ func getNodeEnv() (string, error) {
} }
for key := range k3sEnv { for key := range k3sEnv {
if isSecret(key) { if isSecret(key) {
k3sEnv[key] = "" k3sEnv[key] = OmittedValue
} }
} }
k3sEnvJSON, err := json.Marshal(k3sEnv) k3sEnvJSON, err := json.Marshal(k3sEnv)

Loading…
Cancel
Save