mirror of
https://github.com/k3s-io/k3s.git
synced 2024-06-07 19:41:36 +00:00
Add asterisks for omitted values in nodeconfig
This commit is contained in:
parent
9a21fc513f
commit
356fe006a2
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user