mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-12 21:36:24 +00:00
Merge pull request #126422 from SataQiu/automated-cherry-pick-of-#125566-upstream-release-1.30
Automated cherry pick of #125566: kubeadm: Add '--yes' flag to the list of allowed flags
This commit is contained in:
commit
18b814d83d
@ -606,7 +606,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
|
||||
}
|
||||
|
@ -747,9 +747,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},
|
||||
}
|
||||
@ -765,6 +767,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