mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-04 18:00:08 +00:00
Merge pull request #126740 from neolit123/1.32-allow-config-and-print-manifest
kubeadm: allow mix of --print-manifest and --config flags
This commit is contained in:
commit
2f3e7f515f
@ -609,6 +609,7 @@ func isAllowedFlag(flagName string) bool {
|
||||
kubeadmcmdoptions.NodeName,
|
||||
kubeadmcmdoptions.KubeconfigDir,
|
||||
kubeadmcmdoptions.UploadCerts,
|
||||
kubeadmcmdoptions.PrintManifest,
|
||||
kubeadmcmdoptions.FeatureGatesString, // TODO: remove this line when --feature-gates flag is deprecated and dropped from "kubeadm upgrade apply/plan"
|
||||
"api-server-manifest", "controller-manager-manifest", "scheduler-manifest", // TODO: remove this line when these flags are deprecated and dropped from "kubeadm upgrade diff"
|
||||
"allow-missing-template-keys", "output", "show-managed-fields",
|
||||
|
@ -751,6 +751,7 @@ func TestValidateMixedArguments(t *testing.T) {
|
||||
{[]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},
|
||||
{[]string{"--config=hello", "--print-manifest"}, 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},
|
||||
@ -771,6 +772,7 @@ func TestValidateMixedArguments(t *testing.T) {
|
||||
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.Bool("print-manifest", 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