Skip to content

Commit 9ff0948

Browse files
authored
enable addon management feature gate by default (#222)
Signed-off-by: zhujian <[email protected]>
1 parent 817aa62 commit 9ff0948

File tree

14 files changed

+74
-128
lines changed

14 files changed

+74
-128
lines changed

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ require (
2828
k8s.io/kube-aggregator v0.27.2
2929
k8s.io/utils v0.0.0-20230313181309-38a27ef9d749
3030
open-cluster-management.io/addon-framework v0.7.1-0.20230705031704-6a328fa5cd63
31-
open-cluster-management.io/api v0.11.1-0.20230703133341-6d7212c2e941
31+
open-cluster-management.io/api v0.11.1-0.20230714020829-ef97df044b15
3232
sigs.k8s.io/controller-runtime v0.15.0
3333
sigs.k8s.io/kube-storage-version-migrator v0.0.5
3434
)

go.sum

+2-2
Original file line numberDiff line numberDiff line change
@@ -1158,8 +1158,8 @@ k8s.io/utils v0.0.0-20230313181309-38a27ef9d749 h1:xMMXJlJbsU8w3V5N2FLDQ8YgU8s1E
11581158
k8s.io/utils v0.0.0-20230313181309-38a27ef9d749/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
11591159
open-cluster-management.io/addon-framework v0.7.1-0.20230705031704-6a328fa5cd63 h1:GCsAD1jb6wqhXTHdUM/HcWzv5b2NbZ6FxpLZcxa/jhI=
11601160
open-cluster-management.io/addon-framework v0.7.1-0.20230705031704-6a328fa5cd63/go.mod h1:V+WUFC7GD89Lc68eXSN/FJebnCH4NjrfF44VsO0YAC8=
1161-
open-cluster-management.io/api v0.11.1-0.20230703133341-6d7212c2e941 h1:k10Sx7Th1UDyJ+GYFqWddFq+m6U7x9MHk1g8KwrYy8Y=
1162-
open-cluster-management.io/api v0.11.1-0.20230703133341-6d7212c2e941/go.mod h1:WgKUCJ7+Bf40DsOmH1Gdkpyj3joco+QLzrlM6Ak39zE=
1161+
open-cluster-management.io/api v0.11.1-0.20230714020829-ef97df044b15 h1:S2a+NsIlaPNQAFruowBunN2wHnK2JfyrpnRU783WwMc=
1162+
open-cluster-management.io/api v0.11.1-0.20230714020829-ef97df044b15/go.mod h1:WgKUCJ7+Bf40DsOmH1Gdkpyj3joco+QLzrlM6Ak39zE=
11631163
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
11641164
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
11651165
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=

pkg/operator/helpers/helpers_test.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -1489,15 +1489,15 @@ func TestConvertToFeatureGateFlags(t *testing.T) {
14891489
{Feature: "ClusterClaim", Mode: operatorapiv1.FeatureGateModeTypeEnable},
14901490
{Feature: "AddonManagement", Mode: operatorapiv1.FeatureGateModeTypeEnable},
14911491
},
1492-
desiredFlags: []string{"--feature-gates=AddonManagement=true"},
1492+
desiredFlags: []string{},
14931493
},
14941494
{
14951495
name: "disable feature",
14961496
features: []operatorapiv1.FeatureGate{
14971497
{Feature: "ClusterClaim", Mode: operatorapiv1.FeatureGateModeTypeDisable},
14981498
{Feature: "AddonManagement", Mode: operatorapiv1.FeatureGateModeTypeDisable},
14991499
},
1500-
desiredFlags: []string{"--feature-gates=ClusterClaim=false"},
1500+
desiredFlags: []string{"--feature-gates=ClusterClaim=false", "--feature-gates=AddonManagement=false"},
15011501
},
15021502
{
15031503
name: "invalid feature",
@@ -1514,10 +1514,10 @@ func TestConvertToFeatureGateFlags(t *testing.T) {
15141514
t.Run(tc.name, func(t *testing.T) {
15151515
flags, msg := ConvertToFeatureGateFlags("test", tc.features, ocmfeature.DefaultSpokeRegistrationFeatureGates)
15161516
if msg != tc.desiredMsg {
1517-
t.Errorf("unexpected message, got: %s, desired %s", msg, tc.desiredMsg)
1517+
t.Errorf("Name: %s, unexpected message, got: %s, desired %s", tc.name, msg, tc.desiredMsg)
15181518
}
15191519
if !equality.Semantic.DeepEqual(flags, tc.desiredFlags) {
1520-
t.Errorf("Unexpected flags, got %v, desired %v", flags, tc.desiredFlags)
1520+
t.Errorf("Name: %s, unexpected flags, got %v, desired %v", tc.name, flags, tc.desiredFlags)
15211521
}
15221522
})
15231523
}
@@ -1559,7 +1559,7 @@ func TestFeatureGateEnabled(t *testing.T) {
15591559
t.Run(tc.name, func(t *testing.T) {
15601560
enabled := FeatureGateEnabled(tc.features, ocmfeature.DefaultSpokeRegistrationFeatureGates, tc.featureName)
15611561
if enabled != tc.desiredResult {
1562-
t.Errorf("Expect feature enabled is %v, but got %v", tc.desiredResult, enabled)
1562+
t.Errorf("Name: %s, expect feature enabled is %v, but got %v", tc.name, tc.desiredResult, enabled)
15631563
}
15641564
})
15651565
}

pkg/operator/operators/klusterlet/controllers/klusterletcontroller/klusterlet_controller_test.go

-1
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,6 @@ func assertRegistrationDeployment(t *testing.T, actions []clienttesting.Action,
359359
"agent",
360360
fmt.Sprintf("--spoke-cluster-name=%s", clusterName),
361361
"--bootstrap-kubeconfig=/spoke/bootstrap/kubeconfig",
362-
"--feature-gates=AddonManagement=true",
363362
}
364363

365364
if serverURL != "" {

test/e2e/addonmanagement_test.go

-34
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import (
1818

1919
addonapiv1alpha1 "open-cluster-management.io/api/addon/v1alpha1"
2020
clusterv1apha1 "open-cluster-management.io/api/cluster/v1alpha1"
21-
operatorapiv1 "open-cluster-management.io/api/operator/v1"
2221

2322
"open-cluster-management.io/ocm/pkg/addon/templateagent"
2423
"open-cluster-management.io/ocm/test/e2e/manifests"
@@ -62,39 +61,6 @@ var _ = ginkgo.Describe("Enable addon management feature gate", ginkgo.Ordered,
6261
"addon/signca_secret_rolebinding.yaml",
6362
}
6463

65-
ginkgo.BeforeAll(func() {
66-
// enable addon management feature gate
67-
gomega.Eventually(func() error {
68-
clusterManager, err := t.OperatorClient.OperatorV1().ClusterManagers().Get(context.TODO(), "cluster-manager", metav1.GetOptions{})
69-
if err != nil {
70-
return err
71-
}
72-
clusterManager.Spec.AddOnManagerConfiguration = &operatorapiv1.AddOnManagerConfiguration{
73-
FeatureGates: []operatorapiv1.FeatureGate{
74-
{
75-
Feature: "AddonManagement",
76-
Mode: operatorapiv1.FeatureGateModeTypeEnable,
77-
},
78-
},
79-
}
80-
_, err = t.OperatorClient.OperatorV1().ClusterManagers().Update(context.TODO(), clusterManager, metav1.UpdateOptions{})
81-
return err
82-
}, t.EventuallyTimeout*5, t.EventuallyInterval*5).Should(gomega.Succeed())
83-
})
84-
85-
ginkgo.AfterAll(func() {
86-
// disable addon management feature gate
87-
gomega.Eventually(func() error {
88-
clusterManager, err := t.OperatorClient.OperatorV1().ClusterManagers().Get(context.TODO(), "cluster-manager", metav1.GetOptions{})
89-
if err != nil {
90-
return err
91-
}
92-
clusterManager.Spec.AddOnManagerConfiguration = &operatorapiv1.AddOnManagerConfiguration{}
93-
_, err = t.OperatorClient.OperatorV1().ClusterManagers().Update(context.TODO(), clusterManager, metav1.UpdateOptions{})
94-
return err
95-
}, t.EventuallyTimeout*5, t.EventuallyInterval*5).Should(gomega.Succeed())
96-
})
97-
9864
ginkgo.BeforeEach(func() {
9965
addonInstallNamespace = fmt.Sprintf("%s-addon", agentNamespace)
10066
ginkgo.By("create addon custom sign secret")

test/e2e/work_webhook_test.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,10 @@ var _ = ginkgo.Describe("ManifestWork admission webhook", ginkgo.Label("validati
127127
_, err = impersonatedHubWorkClient.WorkV1().ManifestWorks(clusterName).Create(
128128
context.Background(), work, metav1.CreateOptions{})
129129
gomega.Expect(err).To(gomega.HaveOccurred())
130-
gomega.Expect(errors.IsBadRequest(err)).Should(gomega.BeTrue())
130+
if !errors.IsBadRequest(err) {
131+
// not bad request, assert true=false to show the error message
132+
gomega.Expect(err).ToNot(gomega.HaveOccurred())
133+
}
131134
})
132135
})
133136
})

test/integration/operator/clustermanager_hosted_test.go

+28-31
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ var _ = ginkgo.Describe("ClusterManager Hosted Mode", func() {
4545
var hubWorkWebhookDeployment = fmt.Sprintf("%s-work-webhook", clusterManagerName)
4646
var hubAddOnManagerDeployment = fmt.Sprintf("%s-addon-manager-controller", clusterManagerName)
4747
var hubWorkControllerDeployment = fmt.Sprintf("%s-work-controller", clusterManagerName)
48+
var hubAddonManagerDeployment = fmt.Sprintf("%s-addon-manager-controller", clusterManagerName)
4849
var hubRegistrationClusterRole = fmt.Sprintf("open-cluster-management:%s-registration:controller", clusterManagerName)
4950
var hubRegistrationWebhookClusterRole = fmt.Sprintf("open-cluster-management:%s-registration:webhook", clusterManagerName)
5051
var hubWorkWebhookClusterRole = fmt.Sprintf("open-cluster-management:%s-registration:webhook", clusterManagerName)
@@ -200,6 +201,13 @@ var _ = ginkgo.Describe("ClusterManager Hosted Mode", func() {
200201
return nil
201202
}, eventuallyTimeout, eventuallyInterval).Should(gomega.BeNil())
202203

204+
gomega.Eventually(func() error {
205+
if _, err := hostedKubeClient.AppsV1().Deployments(hubNamespaceHosted).Get(hostedCtx, hubAddonManagerDeployment, metav1.GetOptions{}); err != nil {
206+
return err
207+
}
208+
return nil
209+
}, eventuallyTimeout, eventuallyInterval).Should(gomega.BeNil())
210+
203211
// Check service
204212
gomega.Eventually(func() error {
205213
if _, err := hostedKubeClient.CoreV1().Services(hubNamespaceHosted).Get(hostedCtx, "cluster-manager-registration-webhook", metav1.GetOptions{}); err != nil {
@@ -252,55 +260,37 @@ var _ = ginkgo.Describe("ClusterManager Hosted Mode", func() {
252260
registrationValidtingWebhook := "managedclustervalidators.admission.cluster.open-cluster-management.io"
253261

254262
// Should not apply the webhook config if the replica and observed is not set
255-
_, err := hostedKubeClient.AdmissionregistrationV1().ValidatingWebhookConfigurations().Get(hostedCtx, registrationValidtingWebhook, metav1.GetOptions{})
263+
_, err := hostedKubeClient.AdmissionregistrationV1().ValidatingWebhookConfigurations().Get(
264+
hostedCtx, registrationValidtingWebhook, metav1.GetOptions{})
256265
gomega.Expect(err).To(gomega.HaveOccurred())
257266

258267
workValidtingWebhook := "manifestworkvalidators.admission.work.open-cluster-management.io"
259268
// Should not apply the webhook config if the replica and observed is not set
260-
_, err = hostedKubeClient.AdmissionregistrationV1().ValidatingWebhookConfigurations().Get(hostedCtx, workValidtingWebhook, metav1.GetOptions{})
269+
_, err = hostedKubeClient.AdmissionregistrationV1().ValidatingWebhookConfigurations().Get(
270+
hostedCtx, workValidtingWebhook, metav1.GetOptions{})
261271
gomega.Expect(err).To(gomega.HaveOccurred())
262272

263273
updateDeploymentStatus(hostedKubeClient, hubNamespaceHosted, hubRegistrationWebhookDeployment)
264274
updateDeploymentStatus(hostedKubeClient, hubNamespaceHosted, hubWorkWebhookDeployment)
265275
updateDeploymentStatus(hostedKubeClient, hubNamespaceHosted, hubWorkControllerDeployment)
276+
updateDeploymentStatus(hostedKubeClient, hubNamespaceHosted, hubAddonManagerDeployment)
266277

267278
gomega.Eventually(func() error {
268-
if _, err := hostedKubeClient.AdmissionregistrationV1().ValidatingWebhookConfigurations().Get(hostedCtx, registrationValidtingWebhook, metav1.GetOptions{}); err != nil {
269-
return err
270-
}
271-
return nil
279+
_, err := hostedKubeClient.AdmissionregistrationV1().ValidatingWebhookConfigurations().Get(
280+
hostedCtx, registrationValidtingWebhook, metav1.GetOptions{})
281+
return err
272282
}, eventuallyTimeout, eventuallyInterval).Should(gomega.BeNil())
273283

274-
gomega.Expect(err).To(gomega.HaveOccurred())
275-
276284
gomega.Eventually(func() error {
277-
if _, err := hostedKubeClient.AdmissionregistrationV1().ValidatingWebhookConfigurations().Get(hostedCtx, workValidtingWebhook, metav1.GetOptions{}); err != nil {
278-
return err
279-
}
280-
return nil
285+
_, err := hostedKubeClient.AdmissionregistrationV1().ValidatingWebhookConfigurations().Get(
286+
hostedCtx, workValidtingWebhook, metav1.GetOptions{})
287+
return err
281288
}, eventuallyTimeout, eventuallyInterval).Should(gomega.BeNil())
282289

283290
util.AssertClusterManagerCondition(clusterManagerName, hostedOperatorClient, "Applied", "ClusterManagerApplied", metav1.ConditionTrue)
284291
})
285292

286293
ginkgo.It("should have expected resource created/deleted successfully when feature gates AddOnManager enabled/disabled", func() {
287-
// Check addon manager default mode
288-
gomega.Eventually(func() error {
289-
clusterManager, err := hostedOperatorClient.OperatorV1().ClusterManagers().Get(context.Background(), clusterManagerName, metav1.GetOptions{})
290-
if err != nil {
291-
return err
292-
}
293-
294-
// Check addon manager enabled mode
295-
clusterManager.Spec.AddOnManagerConfiguration = &operatorapiv1.AddOnManagerConfiguration{
296-
FeatureGates: []operatorapiv1.FeatureGate{
297-
{Feature: "AddonManagement", Mode: operatorapiv1.FeatureGateModeTypeEnable},
298-
},
299-
}
300-
_, err = hostedOperatorClient.OperatorV1().ClusterManagers().Update(context.Background(), clusterManager, metav1.UpdateOptions{})
301-
return err
302-
}, eventuallyTimeout, eventuallyInterval).Should(gomega.BeNil())
303-
304294
// Check clusterrole/clusterrolebinding
305295
gomega.Eventually(func() error {
306296
if _, err := hostedKubeClient.RbacV1().ClusterRoles().Get(context.Background(), hubAddOnManagerClusterRole, metav1.GetOptions{}); err != nil {
@@ -350,8 +340,15 @@ var _ = ginkgo.Describe("ClusterManager Hosted Mode", func() {
350340
return err
351341
}
352342

353-
clusterManager.Spec.AddOnManagerConfiguration.FeatureGates = []operatorapiv1.FeatureGate{}
354-
clusterManager, err = hostedOperatorClient.OperatorV1().ClusterManagers().Update(context.Background(), clusterManager, metav1.UpdateOptions{})
343+
clusterManager.Spec.AddOnManagerConfiguration = &operatorapiv1.AddOnManagerConfiguration{
344+
FeatureGates: []operatorapiv1.FeatureGate{
345+
{
346+
Feature: "AddonManagement",
347+
Mode: operatorapiv1.FeatureGateModeTypeDisable,
348+
},
349+
},
350+
}
351+
_, err = hostedOperatorClient.OperatorV1().ClusterManagers().Update(context.Background(), clusterManager, metav1.UpdateOptions{})
355352
return err
356353
}, eventuallyTimeout, eventuallyInterval).Should(gomega.BeNil())
357354

test/integration/operator/clustermanager_test.go

+29-30
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ var _ = ginkgo.Describe("ClusterManager Default Mode", func() {
5252
var hubWorkWebhookDeployment = fmt.Sprintf("%s-work-webhook", clusterManagerName)
5353
var hubAddOnManagerDeployment = fmt.Sprintf("%s-addon-manager-controller", clusterManagerName)
5454
var hubWorkControllerDeployment = fmt.Sprintf("%s-work-controller", clusterManagerName)
55+
var hubAddonManagerDeployment = fmt.Sprintf("%s-addon-manager-controller", clusterManagerName)
5556
var hubRegistrationClusterRole = fmt.Sprintf("open-cluster-management:%s-registration:controller", clusterManagerName)
5657
var hubRegistrationWebhookClusterRole = fmt.Sprintf("open-cluster-management:%s-registration:webhook", clusterManagerName)
5758
var hubWorkWebhookClusterRole = fmt.Sprintf("open-cluster-management:%s-work:webhook", clusterManagerName)
@@ -197,6 +198,14 @@ var _ = ginkgo.Describe("ClusterManager Default Mode", func() {
197198
}
198199
return nil
199200
}, eventuallyTimeout, eventuallyInterval).Should(gomega.BeNil())
201+
202+
gomega.Eventually(func() error {
203+
if _, err := kubeClient.AppsV1().Deployments(hubNamespace).Get(context.Background(), hubAddonManagerDeployment, metav1.GetOptions{}); err != nil {
204+
return err
205+
}
206+
return nil
207+
}, eventuallyTimeout, eventuallyInterval).Should(gomega.BeNil())
208+
200209
// Check service
201210
gomega.Eventually(func() error {
202211
if _, err := kubeClient.CoreV1().Services(hubNamespace).Get(context.Background(), "cluster-manager-registration-webhook", metav1.GetOptions{}); err != nil {
@@ -249,53 +258,36 @@ var _ = ginkgo.Describe("ClusterManager Default Mode", func() {
249258
registrationValidtingWebhook := "managedclustervalidators.admission.cluster.open-cluster-management.io"
250259

251260
// Should not apply the webhook config if the replica and observed is not set
252-
_, err := kubeClient.AdmissionregistrationV1().ValidatingWebhookConfigurations().Get(context.Background(), registrationValidtingWebhook, metav1.GetOptions{})
261+
_, err := kubeClient.AdmissionregistrationV1().ValidatingWebhookConfigurations().Get(
262+
context.Background(), registrationValidtingWebhook, metav1.GetOptions{})
253263
gomega.Expect(err).To(gomega.HaveOccurred())
254264
workValidtingWebhook := "manifestworkvalidators.admission.work.open-cluster-management.io"
255265
// Should not apply the webhook config if the replica and observed is not set
256-
_, err = kubeClient.AdmissionregistrationV1().ValidatingWebhookConfigurations().Get(context.Background(), workValidtingWebhook, metav1.GetOptions{})
266+
_, err = kubeClient.AdmissionregistrationV1().ValidatingWebhookConfigurations().Get(
267+
context.Background(), workValidtingWebhook, metav1.GetOptions{})
257268
gomega.Expect(err).To(gomega.HaveOccurred())
258269

259270
// Update readyreplica of deployment
260-
261271
updateDeploymentStatus(kubeClient, hubNamespace, hubRegistrationWebhookDeployment)
262272
updateDeploymentStatus(kubeClient, hubNamespace, hubWorkWebhookDeployment)
263273
updateDeploymentStatus(kubeClient, hubNamespace, hubWorkControllerDeployment)
274+
updateDeploymentStatus(kubeClient, hubNamespace, hubAddonManagerDeployment)
264275

265276
gomega.Eventually(func() error {
266-
if _, err := kubeClient.AdmissionregistrationV1().ValidatingWebhookConfigurations().Get(context.Background(), registrationValidtingWebhook, metav1.GetOptions{}); err != nil {
267-
return err
268-
}
269-
return nil
277+
_, err := kubeClient.AdmissionregistrationV1().ValidatingWebhookConfigurations().Get(
278+
context.Background(), registrationValidtingWebhook, metav1.GetOptions{})
279+
return err
270280
}, eventuallyTimeout*10, eventuallyInterval).Should(gomega.BeNil())
271281

272282
gomega.Eventually(func() error {
273-
if _, err := kubeClient.AdmissionregistrationV1().ValidatingWebhookConfigurations().Get(context.Background(), workValidtingWebhook, metav1.GetOptions{}); err != nil {
274-
return err
275-
}
276-
return nil
283+
_, err := kubeClient.AdmissionregistrationV1().ValidatingWebhookConfigurations().Get(
284+
context.Background(), workValidtingWebhook, metav1.GetOptions{})
285+
return err
277286
}, eventuallyTimeout, eventuallyInterval).Should(gomega.BeNil())
278287
util.AssertClusterManagerCondition(clusterManagerName, operatorClient, "Applied", "ClusterManagerApplied", metav1.ConditionTrue)
279288
})
280289

281290
ginkgo.It("should have expected resource created/deleted successfully when feature gates AddOnManager enabled/disabled", func() {
282-
// Check addon manager default mode
283-
gomega.Eventually(func() error {
284-
clusterManager, err := operatorClient.OperatorV1().ClusterManagers().Get(context.Background(), clusterManagerName, metav1.GetOptions{})
285-
if err != nil {
286-
return err
287-
}
288-
289-
// Check addon manager enabled mode
290-
clusterManager.Spec.AddOnManagerConfiguration = &operatorapiv1.AddOnManagerConfiguration{
291-
FeatureGates: []operatorapiv1.FeatureGate{
292-
{Feature: "AddonManagement", Mode: operatorapiv1.FeatureGateModeTypeEnable},
293-
},
294-
}
295-
_, err = operatorClient.OperatorV1().ClusterManagers().Update(context.Background(), clusterManager, metav1.UpdateOptions{})
296-
return err
297-
}, eventuallyTimeout, eventuallyInterval).Should(gomega.BeNil())
298-
299291
// Check clusterrole/clusterrolebinding
300292
gomega.Eventually(func() error {
301293
if _, err := kubeClient.RbacV1().ClusterRoles().Get(context.Background(), hubAddOnManagerClusterRole, metav1.GetOptions{}); err != nil {
@@ -345,8 +337,15 @@ var _ = ginkgo.Describe("ClusterManager Default Mode", func() {
345337
return err
346338
}
347339

348-
clusterManager.Spec.AddOnManagerConfiguration.FeatureGates = []operatorapiv1.FeatureGate{}
349-
clusterManager, err = operatorClient.OperatorV1().ClusterManagers().Update(context.Background(), clusterManager, metav1.UpdateOptions{})
340+
clusterManager.Spec.AddOnManagerConfiguration = &operatorapiv1.AddOnManagerConfiguration{
341+
FeatureGates: []operatorapiv1.FeatureGate{
342+
{
343+
Feature: "AddonManagement",
344+
Mode: operatorapiv1.FeatureGateModeTypeDisable,
345+
},
346+
},
347+
}
348+
_, err = operatorClient.OperatorV1().ClusterManagers().Update(context.Background(), clusterManager, metav1.UpdateOptions{})
350349
return err
351350
}, eventuallyTimeout, eventuallyInterval).Should(gomega.BeNil())
352351

test/integration/operator/klusterlet_test.go

+2-8
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,6 @@ var _ = ginkgo.Describe("Klusterlet", func() {
7373
},
7474
ClusterName: "testcluster",
7575
Namespace: klusterletNamespace,
76-
RegistrationConfiguration: &operatorapiv1.RegistrationConfiguration{FeatureGates: []operatorapiv1.FeatureGate{
77-
{
78-
Feature: "AddonManagement",
79-
Mode: "Enable",
80-
},
81-
}},
8276
},
8377
}
8478

@@ -506,7 +500,7 @@ var _ = ginkgo.Describe("Klusterlet", func() {
506500
return false
507501
}
508502
gomega.Expect(len(actual.Spec.Template.Spec.Containers)).Should(gomega.Equal(1))
509-
gomega.Expect(len(actual.Spec.Template.Spec.Containers[0].Args)).Should(gomega.Equal(8))
503+
gomega.Expect(len(actual.Spec.Template.Spec.Containers[0].Args)).Should(gomega.Equal(7))
510504
return actual.Spec.Template.Spec.Containers[0].Args[2] == "--spoke-cluster-name=cluster2"
511505
}, eventuallyTimeout, eventuallyInterval).Should(gomega.BeTrue())
512506

@@ -1003,7 +997,7 @@ var _ = ginkgo.Describe("Klusterlet", func() {
1003997
registrationDeployment, err := kubeClient.AppsV1().Deployments(klusterletNamespace).Get(
1004998
context.Background(), registrationDeploymentName, metav1.GetOptions{})
1005999
gomega.Expect(err).ToNot(gomega.HaveOccurred())
1006-
gomega.Expect(registrationDeployment.Spec.Template.Spec.Containers[0].Args).Should(
1000+
gomega.Expect(registrationDeployment.Spec.Template.Spec.Containers[0].Args).ShouldNot(
10071001
gomega.ContainElement("--feature-gates=AddonManagement=true"))
10081002

10091003
ginkgo.By("Check the work-agent has the expected feature gates")

0 commit comments

Comments
 (0)