Skip to content

Commit

Permalink
Remove worker related flags from GetControllerFlags()
Browse files Browse the repository at this point in the history
Those are also part of GetWorkerFlags(). In fact, the two commands that
use GetControllerFlags() ("controller" and "install"), both also add
GetWorkerFlags(), defining them effectively twice.

Signed-off-by: Tom Wieczorek <[email protected]>
  • Loading branch information
twz123 committed May 6, 2024
1 parent 153331b commit 041fdb3
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions pkg/config/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ func GetWorkerFlags() *pflag.FlagSet {
flagset.StringVar(&workerOpts.WorkerProfile, "profile", "default", "worker profile to use on the node")
flagset.StringVar(&workerOpts.CIDRRange, "cidr-range", "10.96.0.0/12", "HACK: cidr range for the windows worker node")
flagset.BoolVar(&workerOpts.CloudProvider, "enable-cloud-provider", false, "Whether or not to enable cloud provider support in kubelet")
flagset.StringVar(&workerOpts.TokenFile, "token-file", "", "Path to the file containing token.")
flagset.StringVar(&workerOpts.TokenFile, "token-file", "", "Path to the file containing join-token.")
flagset.StringToStringVarP(&workerOpts.CmdLogLevels, "logging", "l", DefaultLogLevels(), "Logging Levels for the different components")
flagset.StringSliceVarP(&workerOpts.Labels, "labels", "", []string{}, "Node labels, list of key=value pairs")
flagset.StringSliceVarP(&workerOpts.Taints, "taints", "", []string{}, "Node taints, list of key=value:effect strings")
Expand Down Expand Up @@ -189,17 +189,13 @@ var availableComponents = []string{
func GetControllerFlags() *pflag.FlagSet {
flagset := &pflag.FlagSet{}

flagset.StringVar(&workerOpts.WorkerProfile, "profile", "default", "worker profile to use on the node")
flagset.BoolVar(&controllerOpts.EnableWorker, "enable-worker", false, "enable worker (default false)")
flagset.StringSliceVar(&controllerOpts.DisableComponents, "disable-components", []string{}, "disable components (valid items: "+strings.Join(availableComponents, ",")+")")
flagset.StringVar(&workerOpts.TokenFile, "token-file", "", "Path to the file containing join-token.")
flagset.StringToStringVarP(&workerOpts.CmdLogLevels, "logging", "l", DefaultLogLevels(), "Logging Levels for the different components")
flagset.BoolVar(&controllerOpts.SingleNode, "single", false, "enable single node (implies --enable-worker, default false)")
flagset.BoolVar(&controllerOpts.NoTaints, "no-taints", false, "disable default taints for controller node")
flagset.BoolVar(&controllerOpts.EnableK0sCloudProvider, "enable-k0s-cloud-provider", false, "enables the k0s-cloud-provider (default false)")
flagset.DurationVar(&controllerOpts.K0sCloudProviderUpdateFrequency, "k0s-cloud-provider-update-frequency", 2*time.Minute, "the frequency of k0s-cloud-provider node updates")
flagset.IntVar(&controllerOpts.K0sCloudProviderPort, "k0s-cloud-provider-port", k0scloudprovider.DefaultBindPort, "the port that k0s-cloud-provider binds on")
flagset.AddFlagSet(GetCriSocketFlag())
flagset.BoolVar(&controllerOpts.EnableDynamicConfig, "enable-dynamic-config", false, "enable cluster-wide dynamic config based on custom resource")
flagset.BoolVar(&controllerOpts.EnableMetricsScraper, "enable-metrics-scraper", false, "enable scraping metrics from the controller components (kube-scheduler, kube-controller-manager)")
flagset.StringVar(&controllerOpts.KubeControllerManagerExtraArgs, "kube-controller-manager-extra-args", "", "extra args for kube-controller-manager")
Expand Down

0 comments on commit 041fdb3

Please sign in to comment.