Skip to content

Commit 9962577

Browse files
authored
Merge pull request kubernetes#94727 from mlevesquedion/fix/avoid-logging-kubeadm-tokens-before-deleting-them
kubeadm: Avoid logging token in RunDeleteTokens
2 parents 66334f0 + fbd62d5 commit 9962577

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

cmd/kubeadm/app/cmd/token.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -420,13 +420,13 @@ func RunDeleteTokens(out io.Writer, client clientset.Interface, tokenIDsOrTokens
420420
for _, tokenIDOrToken := range tokenIDsOrTokens {
421421
// Assume this is a token id and try to parse it
422422
tokenID := tokenIDOrToken
423-
klog.V(1).Infof("[token] parsing token %q", tokenIDOrToken)
423+
klog.V(1).Info("[token] parsing token")
424424
if !bootstraputil.IsValidBootstrapTokenID(tokenIDOrToken) {
425425
// Okay, the full token with both id and secret was probably passed. Parse it and extract the ID only
426426
bts, err := kubeadmapiv1beta2.NewBootstrapTokenString(tokenIDOrToken)
427427
if err != nil {
428-
return errors.Errorf("given token %q didn't match pattern %q or %q",
429-
tokenIDOrToken, bootstrapapi.BootstrapTokenIDPattern, bootstrapapi.BootstrapTokenIDPattern)
428+
return errors.Errorf("given token didn't match pattern %q or %q",
429+
bootstrapapi.BootstrapTokenIDPattern, bootstrapapi.BootstrapTokenIDPattern)
430430
}
431431
tokenID = bts.ID
432432
}

0 commit comments

Comments
 (0)