From 46440696e15ebfcc14b0fa749a46ebf206d86a45 Mon Sep 17 00:00:00 2001 From: Tom Wieczorek Date: Wed, 17 Jan 2024 13:12:10 +0100 Subject: [PATCH] Remove api-config component flag It has been deprecated in k0s 1.27. Time to remove it. See: 144501d31 ("Deprecate api-config component feature gate") Signed-off-by: Tom Wieczorek --- docs/configuration.md | 4 ++-- pkg/config/cli.go | 13 ------------- pkg/constant/constant_shared.go | 1 - 3 files changed, 2 insertions(+), 16 deletions(-) diff --git a/docs/configuration.md b/docs/configuration.md index 214e3572d373..8111f412eb31 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -511,8 +511,8 @@ users to build a minimal Kubernetes control plane and use what ever components they need to fulfill their need for the control plane. Disabling the system components happens through a command line flag for the controller process: -```sh ---disable-components strings disable components (valid items: api-config,autopilot,control-api,coredns,csr-approver,endpoint-reconciler,helm,konnectivity-server,kube-controller-manager,kube-proxy,kube-scheduler,metrics-server,network-provider,node-role,system-rbac,worker-config) +```text +--disable-components strings disable components (valid items: autopilot,control-api,coredns,csr-approver,endpoint-reconciler,helm,konnectivity-server,kube-controller-manager,kube-proxy,kube-scheduler,metrics-server,network-provider,node-role,system-rbac,worker-config) ``` **Note:** As of k0s 1.26, the kubelet-config component has been replaced by the diff --git a/pkg/config/cli.go b/pkg/config/cli.go index 90a4ff47997d..ba4cbd7ed81c 100644 --- a/pkg/config/cli.go +++ b/pkg/config/cli.go @@ -27,7 +27,6 @@ import ( "github.com/k0sproject/k0s/pkg/constant" "github.com/k0sproject/k0s/pkg/k0scloudprovider" - "github.com/sirupsen/logrus" "github.com/spf13/cobra" "github.com/spf13/pflag" "golang.org/x/exp/slices" @@ -95,18 +94,6 @@ func (o *ControllerOptions) Normalize() error { // Normalize component names var disabledComponents []string for _, disabledComponent := range o.DisableComponents { - switch disabledComponent { - case constant.APIConfigComponentName: - logrus.Warnf("Usage of deprecated component name %q, please switch to %q", - constant.APIConfigComponentName, "--enable-dynamic-config=false", - ) - if o.EnableDynamicConfig { - logrus.Warnf("Cannot disable component %q, because %q is selected", - constant.APIConfigComponentName, "--enable-dynamic-config", - ) - } - } - if !slices.Contains(availableComponents, disabledComponent) { return fmt.Errorf("unknown component %s", disabledComponent) } diff --git a/pkg/constant/constant_shared.go b/pkg/constant/constant_shared.go index 9fcff851301a..1df5490029e8 100644 --- a/pkg/constant/constant_shared.go +++ b/pkg/constant/constant_shared.go @@ -96,7 +96,6 @@ const ( /* Controller component names */ - APIConfigComponentName = "api-config" // Deprecated: just don't use dynamic config APIEndpointReconcilerComponentName = "endpoint-reconciler" ControlAPIComponentName = "control-api" CoreDNSComponentname = "coredns"