mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
Merge pull request #113094 from chendave/fix_errmsg
kubeadm: fix the err msg if the token format is not match
This commit is contained in:
commit
cb16d50068
@ -190,7 +190,7 @@ func newCmdToken(out io.Writer, errW io.Writer) *cobra.Command {
|
||||
`),
|
||||
RunE: func(tokenCmd *cobra.Command, args []string) error {
|
||||
if len(args) < 1 {
|
||||
return errors.Errorf("missing subcommand; 'token delete' is missing token of form %q", bootstrapapi.BootstrapTokenIDPattern)
|
||||
return errors.Errorf("missing argument; 'token delete' is missing token of form %q or %q", bootstrapapi.BootstrapTokenPattern, bootstrapapi.BootstrapTokenIDPattern)
|
||||
}
|
||||
kubeConfigFile = cmdutil.GetKubeConfigPath(kubeConfigFile)
|
||||
client, err := cmdutil.GetClientSet(kubeConfigFile, dryRun)
|
||||
@ -416,7 +416,7 @@ func RunDeleteTokens(out io.Writer, client clientset.Interface, tokenIDsOrTokens
|
||||
bts, err := bootstraptokenv1.NewBootstrapTokenString(tokenIDOrToken)
|
||||
if err != nil {
|
||||
return errors.Errorf("given token didn't match pattern %q or %q",
|
||||
bootstrapapi.BootstrapTokenIDPattern, bootstrapapi.BootstrapTokenIDPattern)
|
||||
bootstrapapi.BootstrapTokenPattern, bootstrapapi.BootstrapTokenIDPattern)
|
||||
}
|
||||
tokenID = bts.ID
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user