mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
kubeadm: Add '--yes' flag to the list of allowed flags
Signed-off-by: Marko Mudrinić <mudrinic.mare@gmail.com>
This commit is contained in:
parent
efef32652a
commit
33466a6606
@ -609,7 +609,7 @@ func isAllowedFlag(flagName string) bool {
|
||||
kubeadmcmdoptions.NodeName,
|
||||
kubeadmcmdoptions.KubeconfigDir,
|
||||
kubeadmcmdoptions.UploadCerts,
|
||||
"print-join-command", "rootfs", "v", "log-file")
|
||||
"print-join-command", "rootfs", "v", "log-file", "yes")
|
||||
if allowedFlags.Has(flagName) {
|
||||
return true
|
||||
}
|
||||
|
@ -749,9 +749,11 @@ func TestValidateMixedArguments(t *testing.T) {
|
||||
// Expected to succeed, --config is mixed with skip-* flags only or no other flags
|
||||
{[]string{"--config=hello", "--skip-token-print=true"}, true},
|
||||
{[]string{"--config=hello", "--ignore-preflight-errors=baz", "--skip-token-print"}, true},
|
||||
{[]string{"--config=hello", "--yes=true"}, true},
|
||||
// Expected to fail, --config is mixed with the --foo flag
|
||||
{[]string{"--config=hello", "--ignore-preflight-errors=baz", "--foo=bar"}, false},
|
||||
{[]string{"--config=hello", "--foo=bar"}, false},
|
||||
{[]string{"--config=hello", "--yes=true", "--foo=bar"}, false},
|
||||
// Expected to fail, --config is mixed with the upgrade related flag
|
||||
{[]string{"--config=hello", "--allow-experimental-upgrades"}, false},
|
||||
}
|
||||
@ -767,6 +769,7 @@ func TestValidateMixedArguments(t *testing.T) {
|
||||
f.StringSliceVar(&ignorePreflightErrors, "ignore-preflight-errors", ignorePreflightErrors, "flag not bound to config object")
|
||||
f.Bool("allow-experimental-upgrades", true, "upgrade flags for plan and apply command")
|
||||
f.Bool("skip-token-print", false, "flag not bound to config object")
|
||||
f.Bool("yes", false, "flag not bound to config object")
|
||||
f.StringVar(&cfgPath, "config", cfgPath, "Path to kubeadm config file")
|
||||
if err := f.Parse(rt.args); err != nil {
|
||||
t.Fatal(err)
|
||||
|
Loading…
Reference in New Issue
Block a user