mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 05:27:21 +00:00
kubeadm: fix to avoid panic if token not provided
Prior to this, kubeadm would panic if no token was provided. This does a check and prints out a more reasonable message.
This commit is contained in:
parent
beaf5ffacc
commit
ff5801ad0c
@ -92,6 +92,9 @@ func NewCmdToken(out io.Writer, errW io.Writer) *cobra.Command {
|
||||
Use: "delete",
|
||||
Short: "Delete bootstrap tokens on the server.",
|
||||
Run: func(tokenCmd *cobra.Command, args []string) {
|
||||
if len(args) < 1 {
|
||||
kubeadmutil.CheckErr(fmt.Errorf("missing subcommand; 'token delete' is missing token of form [\"^([a-z0-9]{6})$\"]"))
|
||||
}
|
||||
err := RunDeleteToken(out, tokenCmd, args[0])
|
||||
kubeadmutil.CheckErr(err)
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user