From a158006b3f392f06e85516a4e5fc9ab4ed78998f Mon Sep 17 00:00:00 2001 From: Tom Wieczorek Date: Thu, 11 Apr 2024 17:39:49 +0200 Subject: [PATCH] Remove worker related flags from GetControllerFlags() 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 --- pkg/config/cli.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/pkg/config/cli.go b/pkg/config/cli.go index 9d565b0a2bf1..8e96a41472c0 100644 --- a/pkg/config/cli.go +++ b/pkg/config/cli.go @@ -156,7 +156,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") @@ -190,17 +190,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")