Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automated cherry pick of #15725: kubetest2: Mark --control-plane-size as deprecated #15728

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 3 additions & 10 deletions tests/e2e/kubetest2-kops/deployer/deployer.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,20 +122,13 @@ func New(opts types.Options) (types.Deployer, *pflag.FlagSet) {
// register flags
fs := bindFlags(d)

fs.IntVar(&d.ControlPlaneCount, "control-plane-size", d.ControlPlaneCount, "Number of control-plane instances")
fs.MarkDeprecated("control-plane-size", "use --control-plane-count instead")

// register flags for klog
klog.InitFlags(nil)
fs.AddGoFlagSet(flag.CommandLine)

// Map deprecated flag names to their new names
fs.SetNormalizeFunc(func(f *pflag.FlagSet, name string) pflag.NormalizedName {
switch name {
case "control-plane-size":
klog.Warningf("deprecated --control-plane-size specified; please use --control-plane-count instead")
name = "control-plane-count"
}
return pflag.NormalizedName(name)
})

return d, fs
}

Expand Down
Loading