kubeadm: allow usage --config with --print-join-command

kubeadm token create  --print-join-command --config <path>
fails with Error: can not mix '--config' with arguments [print-join-command]

As print-joint command can't be put into the configuration file it
should be possible to use those 2 options at the same time.

Added print-join-command options to the list of exceptions in
ValidateMixedArguments check to allow its usage with --config option.

Fixes: kubernetes/kubeadm#1166
pull/58/head
Ed Bartosh 2018-10-10 15:49:18 +03:00
parent 85d52d8a2b
commit eacff9436e
1 changed files with 1 additions and 1 deletions

View File

@ -380,7 +380,7 @@ func ValidateMixedArguments(flag *pflag.FlagSet) error {
mixedInvalidFlags := []string{}
flag.Visit(func(f *pflag.Flag) {
if f.Name == "config" || f.Name == "ignore-preflight-errors" || strings.HasPrefix(f.Name, "skip-") || f.Name == "dry-run" || f.Name == "kubeconfig" || f.Name == "v" || f.Name == "rootfs" {
if f.Name == "config" || f.Name == "ignore-preflight-errors" || strings.HasPrefix(f.Name, "skip-") || f.Name == "dry-run" || f.Name == "kubeconfig" || f.Name == "v" || f.Name == "rootfs" || f.Name == "print-join-command" {
// "--skip-*" flags or other whitelisted flags can be set with --config
return
}