From 5a107e30f87b3b1800af3b3ea86d4e1275c4281e Mon Sep 17 00:00:00 2001 From: Rafael Franzke Date: Wed, 10 Apr 2024 12:37:16 +0200 Subject: [PATCH] Cleanup handling for disabled UseGardenerNodeAgent feature gate --- .../templates/deployment.yaml | 2 -- .../app/app.go | 4 --- example/controller-registration.yaml | 2 +- pkg/webhook/controlplane/add.go | 4 +-- pkg/webhook/controlplane/ensurer.go | 17 +++++------ pkg/webhook/controlplane/ensurer_test.go | 30 +++++++++---------- 6 files changed, 24 insertions(+), 35 deletions(-) diff --git a/charts/gardener-extension-provider-aws/templates/deployment.yaml b/charts/gardener-extension-provider-aws/templates/deployment.yaml index 46a655c3f..270d4d800 100644 --- a/charts/gardener-extension-provider-aws/templates/deployment.yaml +++ b/charts/gardener-extension-provider-aws/templates/deployment.yaml @@ -69,8 +69,6 @@ spec: - --webhook-config-server-port={{ .Values.webhookConfig.serverPort }} - --disable-controllers={{ .Values.disableControllers | join "," }} - --disable-webhooks={{ .Values.disableWebhooks | join "," }} - - --gardenlet-uses-gardener-node-agent={{ ternary .Values.gardener.gardenlet.featureGates.UseGardenerNodeAgent true (hasKey .Values.gardener.gardenlet.featureGates "UseGardenerNodeAgent") }} - {{- if .Values.metricsPort }} - --metrics-bind-address=:{{ .Values.metricsPort }} {{- end }} diff --git a/cmd/gardener-extension-provider-aws/app/app.go b/cmd/gardener-extension-provider-aws/app/app.go index ac06f36bb..d6641ae5f 100644 --- a/cmd/gardener-extension-provider-aws/app/app.go +++ b/cmd/gardener-extension-provider-aws/app/app.go @@ -42,7 +42,6 @@ import ( "github.com/gardener/gardener-extension-provider-aws/pkg/controller/healthcheck" awsinfrastructure "github.com/gardener/gardener-extension-provider-aws/pkg/controller/infrastructure" awsworker "github.com/gardener/gardener-extension-provider-aws/pkg/controller/worker" - "github.com/gardener/gardener-extension-provider-aws/pkg/webhook/controlplane" awscontrolplaneexposure "github.com/gardener/gardener-extension-provider-aws/pkg/webhook/controlplaneexposure" ) @@ -241,9 +240,6 @@ func NewControllerManagerCommand(ctx context.Context) *cobra.Command { workerCtrlOpts.Completed().Apply(&awsworker.DefaultAddOptions.Controller) awsworker.DefaultAddOptions.GardenCluster = gardenCluster - // TODO(KA): remove when gardener-node-agent becomes default - controlplane.NodeAgentEnabled = generalOpts.Completed().GardenletUsesGardenerNodeAgent - atomicShootWebhookConfig, err := webhookOptions.Completed().AddToManager(ctx, mgr, nil) if err != nil { return fmt.Errorf("could not add webhooks to manager: %w", err) diff --git a/example/controller-registration.yaml b/example/controller-registration.yaml index 5fd0fee94..f8884e5bc 100644 --- a/example/controller-registration.yaml +++ b/example/controller-registration.yaml @@ -5,7 +5,7 @@ metadata: name: provider-aws type: helm providerConfig: - chart: H4sIAAAAAAAAA+09a3PbtrL9rF+Bo6TTNlNSD8t2jmZy5yi2m3raOLq2m94znY6HIiEJNUWyBClHTfPf7y4AkuBDoui4TnMOMZmYBHcXi9fuYrGAFlboUI+GBn0XUY8z3zOC0F8zB7KsO9774gFSH9Lx4aH4C6n4VzwPDkaD4eHw6AjzB4fHx6MvyOFDFF6XYh5ZISFfhL4f7YKr+/6ZpkVN/58srTAyN9bKvX8Z2MFHo9HW/h8eFPv/+HgA/d9/uGpuT//l/W8F7C0Nsd/HZD3oWEGQvnYHZr/bcSi3QxZEImtCvqfuitg4KMjcD0m0pOSVGkJk8vMVmarBQ9Lx1PGsFR2TmoHWWSfF9k0ot/Op2+W/JdXNf8e3zYX/cWXUzP9BH3RDYf73jwft/H+M1OuRq+np/xnfMZee+MEmZItldA2DYUyG/eGIXE2m5OqMwFS3PPFizefMZVZEie2vAsvbwAcnkwG270Uhm8WRH/JOr9dJ6P/IbBhe1DgHsIjNGQ1BmgSWvaTGEKY7wC388QJJIGm+JIZNujMLHp6+mlyenl2cXd58Pzn54eb0/LKXwBmiNN91YbCGdMF4BLkwhE3ENwLfMTi145BFG4N6IK5s+iII2RqquqAO0cc5McnTr20rIqbZg39vzy6vzt9cfKNe6TtrFbi0t604VI/kpWXfx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YKTLCH7oHZ76qMdaK9DMzBwHz/ZbdqUGqVdMYNhvKDaZqdTs7WL68zTB0HYzIaHais5CTdoD887MOkeEISh4r4AQzFaL4n1FyYhCd3u8w2RLiWsotUADLhSlgb4JHsML2aJYEVH1NumdwWo5hmx07prb7suOqqY9BIkXtjod5v3PdSrTy9driyhLgQeKAuBlG39Q4O8DW7O7dwc65dvmFE2n6MucWjpFB6O+7z/mumMnP2nbz7EmM86Sy5nKPCmoO865UfvmJAIrScw/fkSKRmaJH9l5A17ujTA+0v8oubMP85cCLge69RhgohRsSIjnO8U9x8LTtCu28lmSDZ5qXK9aYfyUolY2teb1Ob2tSmNrWpTW1qU5va1KY2talNbWpTm9rUpja16UtM/w9hDqahAKAAAA== values: image: tag: v1.54.0-dev diff --git a/pkg/webhook/controlplane/add.go b/pkg/webhook/controlplane/add.go index 8e5c3de6e..99d13b122 100644 --- a/pkg/webhook/controlplane/add.go +++ b/pkg/webhook/controlplane/add.go @@ -21,8 +21,6 @@ import ( var ( logger = log.Log.WithName("aws-controlplane-webhook") - // NodeAgentEnabled indicates whether the gardener node-agent feature flag is enabled in gardenlet. - NodeAgentEnabled bool ) // AddToManager creates a webhook and adds it to the manager. @@ -37,7 +35,7 @@ func AddToManager(mgr manager.Manager) (*extensionswebhook.Webhook, error) { {Obj: &vpaautoscalingv1.VerticalPodAutoscaler{}}, {Obj: &extensionsv1alpha1.OperatingSystemConfig{}}, }, - Mutator: genericmutator.NewMutator(mgr, NewEnsurer(logger, mgr.GetClient(), NodeAgentEnabled), oscutils.NewUnitSerializer(), + Mutator: genericmutator.NewMutator(mgr, NewEnsurer(logger, mgr.GetClient()), oscutils.NewUnitSerializer(), kubelet.NewConfigCodec(fciCodec), fciCodec, logger), }) } diff --git a/pkg/webhook/controlplane/ensurer.go b/pkg/webhook/controlplane/ensurer.go index bc393f699..1d8c2b0bf 100644 --- a/pkg/webhook/controlplane/ensurer.go +++ b/pkg/webhook/controlplane/ensurer.go @@ -43,19 +43,17 @@ const ( ) // NewEnsurer creates a new controlplane ensurer. -func NewEnsurer(logger logr.Logger, client client.Client, nodeAgentEnabled bool) genericmutator.Ensurer { +func NewEnsurer(logger logr.Logger, client client.Client) genericmutator.Ensurer { return &ensurer{ - logger: logger.WithName("aws-controlplane-ensurer"), - client: client, - nodeAgentEnabled: nodeAgentEnabled, + logger: logger.WithName("aws-controlplane-ensurer"), + client: client, } } type ensurer struct { genericmutator.NoopEnsurer - logger logr.Logger - client client.Client - nodeAgentEnabled bool + logger logr.Logger + client client.Client } // ImageVector is exposed for testing. @@ -350,8 +348,7 @@ func (e *ensurer) EnsureKubeletServiceUnitOptions(ctx context.Context, gctx gcon return nil, err } - // the ECR feature only works with node agent. - if e.nodeAgentEnabled && k8sGreaterEqual127 { + if k8sGreaterEqual127 { infra := &extensionsv1alpha1.Infrastructure{} if err := e.client.Get(ctx, client.ObjectKey{ Namespace: cluster.ObjectMeta.Name, @@ -569,7 +566,7 @@ func (e *ensurer) EnsureAdditionalFiles(ctx context.Context, gctx gcontext.Garde } // return early - if !(e.nodeAgentEnabled && k8sGreaterEqual127) { + if !k8sGreaterEqual127 { return nil } diff --git a/pkg/webhook/controlplane/ensurer_test.go b/pkg/webhook/controlplane/ensurer_test.go index b0feea71f..3b4326f5f 100644 --- a/pkg/webhook/controlplane/ensurer_test.go +++ b/pkg/webhook/controlplane/ensurer_test.go @@ -139,7 +139,7 @@ var _ = Describe("Ensurer", func() { }, } - ensurer = NewEnsurer(logger, c, true) + ensurer = NewEnsurer(logger, c) }) It("should add missing elements to kube-apiserver deployment (k8s < 1.27)", func() { @@ -222,7 +222,7 @@ var _ = Describe("Ensurer", func() { }, } - ensurer = NewEnsurer(logger, c, true) + ensurer = NewEnsurer(logger, c) }) It("should add missing elements to kube-controller-manager deployment (k8s < 1.27)", func() { @@ -300,7 +300,7 @@ var _ = Describe("Ensurer", func() { }, } - ensurer = NewEnsurer(logger, c, true) + ensurer = NewEnsurer(logger, c) }) It("should add missing elements to kube-scheduler deployment (k8s < 1.27)", func() { @@ -340,7 +340,7 @@ var _ = Describe("Ensurer", func() { }, } - ensurer = NewEnsurer(logger, c, true) + ensurer = NewEnsurer(logger, c) }) It("should add missing elements to cluster-autoscaler deployment (>= 1.27)", func() { @@ -381,7 +381,7 @@ ExecStart=/opt/bin/mtu-customizer.sh ) // Create ensurer - ensurer := NewEnsurer(logger, c, true) + ensurer := NewEnsurer(logger, c) // Call EnsureAdditionalUnits method and check the result err := ensurer.EnsureAdditionalUnits(ctx, eContextK8s126, &units, nil) @@ -459,7 +459,7 @@ done ) // Create ensurer - ensurer := NewEnsurer(logger, c, true) + ensurer := NewEnsurer(logger, c) // Call EnsureAdditionalFiles method and check the result err = ensurer.EnsureAdditionalFiles(ctx, eContextK8s127, &files, nil) @@ -485,7 +485,7 @@ done ) // Create ensurer - ensurer := NewEnsurer(logger, c, true) + ensurer := NewEnsurer(logger, c) // Call EnsureAdditionalFiles method and check the result err := ensurer.EnsureAdditionalFiles(ctx, eContextK8s126, &files, nil) @@ -519,7 +519,7 @@ done ) // Create ensurer - ensurer := NewEnsurer(logger, c, true) + ensurer := NewEnsurer(logger, c) // Call EnsureAdditionalFiles method and check the result err := ensurer.EnsureAdditionalFiles(ctx, eContextK8s127, &files, nil) @@ -545,7 +545,7 @@ done ) // Create ensurer - ensurer := NewEnsurer(logger, c, true) + ensurer := NewEnsurer(logger, c) // Call EnsureAdditionalFiles method and check the result err := ensurer.EnsureAdditionalFiles(ctx, eContextK8s126, &files, nil) @@ -571,7 +571,7 @@ done ) // Create ensurer - ensurer := NewEnsurer(logger, c, true) + ensurer := NewEnsurer(logger, c) // Call EnsureAdditionalFiles method and check the result err := ensurer.EnsureAdditionalFiles(ctx, eContextK8s126, &files, nil) @@ -590,7 +590,7 @@ done ) BeforeEach(func() { - ensurer = NewEnsurer(logger, c, true) + ensurer = NewEnsurer(logger, c) oldUnitOptions = []*unit.UnitOption{ { Section: "Service", @@ -663,7 +663,7 @@ done ) BeforeEach(func() { - ensurer = NewEnsurer(logger, c, true) + ensurer = NewEnsurer(logger, c) oldKubeletConfig = &kubeletconfigv1beta1.KubeletConfiguration{ FeatureGates: map[string]bool{ "Foo": true, @@ -701,7 +701,7 @@ done var ensurer genericmutator.Ensurer BeforeEach(func() { - ensurer = NewEnsurer(logger, c, true) + ensurer = NewEnsurer(logger, c) }) It("should modify existing elements of kubernetes general configuration", func() { @@ -751,7 +751,7 @@ done BeforeEach(func() { deployment = &appsv1.Deployment{ObjectMeta: metav1.ObjectMeta{Namespace: "foo"}} - ensurer = NewEnsurer(logger, c, true) + ensurer = NewEnsurer(logger, c) DeferCleanup(testutils.WithVar(&ImageVector, imagevectorutils.ImageVector{{ Name: "machine-controller-manager-provider-aws", Repository: "foo", @@ -811,7 +811,7 @@ done BeforeEach(func() { vpa = &vpaautoscalingv1.VerticalPodAutoscaler{} - ensurer = NewEnsurer(logger, c, true) + ensurer = NewEnsurer(logger, c) }) It("should inject the sidecar container policy", func() {