Skip to content

Commit

Permalink
Merge pull request #15725 from hakman/mark_deprecated_control-plane-size
Browse files Browse the repository at this point in the history
kubetest2: Mark `--control-plane-size` as deprecated
  • Loading branch information
k8s-ci-robot committed Aug 1, 2023
2 parents bfefb0c + 99e0475 commit 47f04e2
Showing 1 changed file with 3 additions and 10 deletions.
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

0 comments on commit 47f04e2

Please sign in to comment.