Skip to content

Commit 0c004bc

Browse files
Fix webhook method interface input args for ValidateUpate (#9755)
1 parent 071a3d1 commit 0c004bc

34 files changed

+276
-276
lines changed

pkg/api/v1alpha1/awsiamconfig_webhook.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ func (r *AWSIamConfig) ValidateCreate(_ context.Context, obj runtime.Object) (ad
5959
}
6060

6161
// ValidateUpdate implements webhook.CustomValidator so a webhook will be registered for the type.
62-
func (r *AWSIamConfig) ValidateUpdate(_ context.Context, obj, old runtime.Object) (admission.Warnings, error) {
62+
func (r *AWSIamConfig) ValidateUpdate(_ context.Context, old, obj runtime.Object) (admission.Warnings, error) {
6363
awsIamConfig, ok := obj.(*AWSIamConfig)
6464
if !ok {
6565
return nil, fmt.Errorf("expected an AWSIamConfig but got %T", obj)

pkg/api/v1alpha1/awsiamconfig_webhook_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ func TestValidateUpdateAWSIamConfigFail(t *testing.T) {
1818

1919
aiNew.Spec.BackendMode = []string{"mode1"}
2020
g := NewWithT(t)
21-
g.Expect(aiNew.ValidateUpdate(ctx, aiNew, &aiOld)).Error().To(MatchError(ContainSubstring("config is immutable")))
21+
g.Expect(aiNew.ValidateUpdate(ctx, &aiOld, aiNew)).Error().To(MatchError(ContainSubstring("config is immutable")))
2222
}
2323

2424
func TestValidateUpdateAWSIamConfigSuccess(t *testing.T) {
@@ -35,7 +35,7 @@ func TestValidateUpdateAWSIamConfigSuccess(t *testing.T) {
3535
},
3636
}
3737
g := NewWithT(t)
38-
g.Expect(aiNew.ValidateUpdate(ctx, aiNew, &aiOld)).Error().To(Succeed())
38+
g.Expect(aiNew.ValidateUpdate(ctx, &aiOld, aiNew)).Error().To(Succeed())
3939
}
4040

4141
func TestValidateCreateAWSIamConfigSuccess(t *testing.T) {
@@ -69,7 +69,7 @@ func TestValidateUpdateAWSIamConfigFailCausedByMutableFieldChange(t *testing.T)
6969
},
7070
}
7171
g := NewWithT(t)
72-
g.Expect(aiNew.ValidateUpdate(ctx, aiNew, &aiOld)).Error().To(MatchError(ContainSubstring("MapRoles Username is required")))
72+
g.Expect(aiNew.ValidateUpdate(ctx, &aiOld, aiNew)).Error().To(MatchError(ContainSubstring("MapRoles Username is required")))
7373
}
7474

7575
func TestAWSIamConfigSetDefaults(t *testing.T) {
@@ -140,7 +140,7 @@ func TestAWSIamConfigValidateUpdateCastFail(t *testing.T) {
140140
config := &v1alpha1.AWSIamConfig{}
141141

142142
// Call ValidateUpdate with the wrong type
143-
warnings, err := config.ValidateUpdate(context.TODO(), wrongType, &v1alpha1.AWSIamConfig{})
143+
warnings, err := config.ValidateUpdate(context.TODO(), &v1alpha1.AWSIamConfig{}, wrongType)
144144

145145
// Verify that an error is returned
146146
g.Expect(warnings).To(BeNil())

pkg/api/v1alpha1/cloudstackdatacenterconfig_webhook.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ func (r *CloudStackDatacenterConfig) ValidateCreate(_ context.Context, obj runti
8080
}
8181

8282
// ValidateUpdate implements webhook.CustomValidator so a webhook will be registered for the type.
83-
func (r *CloudStackDatacenterConfig) ValidateUpdate(_ context.Context, obj, old runtime.Object) (admission.Warnings, error) {
83+
func (r *CloudStackDatacenterConfig) ValidateUpdate(_ context.Context, old, obj runtime.Object) (admission.Warnings, error) {
8484
cloudstackConfig, ok := obj.(*CloudStackDatacenterConfig)
8585
if !ok {
8686
return nil, fmt.Errorf("expected a CloudStackDatacenterConfig but got %T", obj)

pkg/api/v1alpha1/cloudstackdatacenterconfig_webhook_test.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ func TestCloudStackDatacenterValidateUpdateDomainImmutable(t *testing.T) {
5454

5555
c.Spec.AvailabilityZones[0].Domain = "shinyNewDomain"
5656
g := NewWithT(t)
57-
g.Expect(c.ValidateUpdate(ctx, c, &vOld)).Error().To(HaveOccurred())
57+
g.Expect(c.ValidateUpdate(ctx, &vOld, c)).Error().To(HaveOccurred())
5858
}
5959

6060
func TestCloudStackDatacenterValidateUpdateV1beta1ToV1beta2Upgrade(t *testing.T) {
@@ -65,7 +65,7 @@ func TestCloudStackDatacenterValidateUpdateV1beta1ToV1beta2Upgrade(t *testing.T)
6565

6666
vNew.Spec.AvailabilityZones[0].Name = "12345678-abcd-4abc-abcd-abcd12345678"
6767
g := NewWithT(t)
68-
g.Expect(vNew.ValidateUpdate(ctx, vNew, &vOld)).Error().To(Succeed())
68+
g.Expect(vNew.ValidateUpdate(ctx, &vOld, vNew)).Error().To(Succeed())
6969
}
7070

7171
func TestCloudStackDatacenterValidateUpdateV1beta1ToV1beta2UpgradeAddAzInvalid(t *testing.T) {
@@ -77,7 +77,7 @@ func TestCloudStackDatacenterValidateUpdateV1beta1ToV1beta2UpgradeAddAzInvalid(t
7777
vNew.Spec.AvailabilityZones[0].Name = "12345678-abcd-4abc-abcd-abcd12345678"
7878
vNew.Spec.AvailabilityZones = append(vNew.Spec.AvailabilityZones, vNew.Spec.AvailabilityZones[0])
7979
g := NewWithT(t)
80-
g.Expect(vNew.ValidateUpdate(ctx, vNew, &vOld)).Error().To(HaveOccurred())
80+
g.Expect(vNew.ValidateUpdate(ctx, &vOld, vNew)).Error().To(HaveOccurred())
8181
}
8282

8383
func TestCloudStackDatacenterValidateUpdateRenameAzInvalid(t *testing.T) {
@@ -88,7 +88,7 @@ func TestCloudStackDatacenterValidateUpdateRenameAzInvalid(t *testing.T) {
8888

8989
vNew.Spec.AvailabilityZones[0].Name = "shinyNewAzName"
9090
g := NewWithT(t)
91-
g.Expect(vNew.ValidateUpdate(ctx, vNew, &vOld)).Error().To(HaveOccurred())
91+
g.Expect(vNew.ValidateUpdate(ctx, &vOld, vNew)).Error().To(HaveOccurred())
9292
}
9393

9494
func TestCloudStackDatacenterValidateUpdateManagementApiEndpointImmutable(t *testing.T) {
@@ -99,7 +99,7 @@ func TestCloudStackDatacenterValidateUpdateManagementApiEndpointImmutable(t *tes
9999

100100
c.Spec.AvailabilityZones[0].ManagementApiEndpoint = "shinyNewManagementApiEndpoint"
101101
g := NewWithT(t)
102-
g.Expect(c.ValidateUpdate(ctx, c, &vOld)).Error().To(HaveOccurred())
102+
g.Expect(c.ValidateUpdate(ctx, &vOld, c)).Error().To(HaveOccurred())
103103
}
104104

105105
func TestCloudStackDatacenterValidateUpdateZonesImmutable(t *testing.T) {
@@ -109,7 +109,7 @@ func TestCloudStackDatacenterValidateUpdateZonesImmutable(t *testing.T) {
109109

110110
c.Spec.AvailabilityZones[0].Zone.Name = "shinyNewZone"
111111
g := NewWithT(t)
112-
g.Expect(c.ValidateUpdate(ctx, c, &vOld)).Error().To(HaveOccurred())
112+
g.Expect(c.ValidateUpdate(ctx, &vOld, c)).Error().To(HaveOccurred())
113113
}
114114

115115
func TestCloudStackDatacenterValidateUpdateAccountImmutable(t *testing.T) {
@@ -119,7 +119,7 @@ func TestCloudStackDatacenterValidateUpdateAccountImmutable(t *testing.T) {
119119

120120
c.Spec.AvailabilityZones[0].Account = "shinyNewAccount"
121121
g := NewWithT(t)
122-
g.Expect(c.ValidateUpdate(ctx, c, &vOld)).Error().To(HaveOccurred())
122+
g.Expect(c.ValidateUpdate(ctx, &vOld, c)).Error().To(HaveOccurred())
123123
}
124124

125125
func TestCloudStackDatacenterValidateUpdateNetworkImmutable(t *testing.T) {
@@ -129,7 +129,7 @@ func TestCloudStackDatacenterValidateUpdateNetworkImmutable(t *testing.T) {
129129

130130
c.Spec.AvailabilityZones[0].Zone.Network.Name = "GuestNet2"
131131
g := NewWithT(t)
132-
g.Expect(c.ValidateUpdate(ctx, c, &vOld)).Error().To(HaveOccurred())
132+
g.Expect(c.ValidateUpdate(ctx, &vOld, c)).Error().To(HaveOccurred())
133133
}
134134

135135
func TestCloudStackDatacenterValidateUpdateWithPausedAnnotation(t *testing.T) {
@@ -157,7 +157,7 @@ func TestCloudStackDatacenterValidateUpdateWithPausedAnnotation(t *testing.T) {
157157
vOld.PauseReconcile()
158158

159159
g := NewWithT(t)
160-
g.Expect(c.ValidateUpdate(ctx, c, &vOld)).Error().To(Succeed())
160+
g.Expect(c.ValidateUpdate(ctx, &vOld, c)).Error().To(Succeed())
161161
}
162162

163163
func TestCloudStackDatacenterValidateUpdateInvalidType(t *testing.T) {
@@ -166,7 +166,7 @@ func TestCloudStackDatacenterValidateUpdateInvalidType(t *testing.T) {
166166
c := &v1alpha1.CloudStackDatacenterConfig{}
167167

168168
g := NewWithT(t)
169-
g.Expect(c.ValidateUpdate(ctx, c, vOld)).Error().To(HaveOccurred())
169+
g.Expect(c.ValidateUpdate(ctx, vOld, c)).Error().To(HaveOccurred())
170170
}
171171

172172
func cloudstackDatacenterConfig() v1alpha1.CloudStackDatacenterConfig {
@@ -235,7 +235,7 @@ func TestCloudStackDatacenterConfigValidateUpdateCastFail(t *testing.T) {
235235
config := &v1alpha1.CloudStackDatacenterConfig{}
236236

237237
// Call ValidateUpdate with the wrong type
238-
warnings, err := config.ValidateUpdate(context.TODO(), wrongType, &v1alpha1.CloudStackDatacenterConfig{})
238+
warnings, err := config.ValidateUpdate(context.TODO(), &v1alpha1.CloudStackDatacenterConfig{}, wrongType)
239239

240240
// Verify that an error is returned
241241
g.Expect(warnings).To(BeNil())

pkg/api/v1alpha1/cloudstackmachineconfig_webhook.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ func (r *CloudStackMachineConfig) ValidateCreate(_ context.Context, obj runtime.
5353
}
5454

5555
// ValidateUpdate implements webhook.CustomValidator so a webhook will be registered for the type.
56-
func (r *CloudStackMachineConfig) ValidateUpdate(_ context.Context, obj, old runtime.Object) (admission.Warnings, error) {
56+
func (r *CloudStackMachineConfig) ValidateUpdate(_ context.Context, old, obj runtime.Object) (admission.Warnings, error) {
5757
cloudstackConfig, ok := obj.(*CloudStackMachineConfig)
5858
if !ok {
5959
return nil, fmt.Errorf("expected a CloudStackMachineConfig but got %T", obj)

pkg/api/v1alpha1/cloudstackmachineconfig_webhook_test.go

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ func TestCPCloudStackMachineValidateUpdateTemplateMutable(t *testing.T) {
197197
Name: "newTemplate",
198198
}
199199
g := NewWithT(t)
200-
g.Expect(c.ValidateUpdate(ctx, c, &vOld)).Error().To(Succeed())
200+
g.Expect(c.ValidateUpdate(ctx, &vOld, c)).Error().To(Succeed())
201201
}
202202

203203
func TestWorkersCPCloudStackMachineValidateUpdateTemplateMutable(t *testing.T) {
@@ -212,7 +212,7 @@ func TestWorkersCPCloudStackMachineValidateUpdateTemplateMutable(t *testing.T) {
212212
Name: "newTemplate",
213213
}
214214
g := NewWithT(t)
215-
g.Expect(c.ValidateUpdate(ctx, c, &vOld)).Error().To(Succeed())
215+
g.Expect(c.ValidateUpdate(ctx, &vOld, c)).Error().To(Succeed())
216216
}
217217

218218
func TestCPCloudStackMachineValidateUpdateComputeOfferingMutable(t *testing.T) {
@@ -228,7 +228,7 @@ func TestCPCloudStackMachineValidateUpdateComputeOfferingMutable(t *testing.T) {
228228
Name: "newComputeOffering",
229229
}
230230
g := NewWithT(t)
231-
g.Expect(c.ValidateUpdate(ctx, c, &vOld)).Error().To(Succeed())
231+
g.Expect(c.ValidateUpdate(ctx, &vOld, c)).Error().To(Succeed())
232232
}
233233

234234
func TestCPCloudStackMachineValidateUpdateDiskOfferingMutable(t *testing.T) {
@@ -256,7 +256,7 @@ func TestCPCloudStackMachineValidateUpdateDiskOfferingMutable(t *testing.T) {
256256
Label: "data_disk",
257257
}
258258
g := NewWithT(t)
259-
g.Expect(c.ValidateUpdate(ctx, c, &vOld)).Error().To(Succeed())
259+
g.Expect(c.ValidateUpdate(ctx, &vOld, c)).Error().To(Succeed())
260260
}
261261

262262
func TestCPCloudStackMachineValidateUpdateDiskOfferingMutableFailInvalidMountPath(t *testing.T) {
@@ -284,7 +284,7 @@ func TestCPCloudStackMachineValidateUpdateDiskOfferingMutableFailInvalidMountPat
284284
Label: "data_disk",
285285
}
286286
g := NewWithT(t)
287-
g.Expect(c.ValidateUpdate(ctx, c, &vOld)).Error().NotTo(Succeed())
287+
g.Expect(c.ValidateUpdate(ctx, &vOld, c)).Error().NotTo(Succeed())
288288
}
289289

290290
func TestCPCloudStackMachineValidateUpdateDiskOfferingMutableFailEmptyDevice(t *testing.T) {
@@ -312,7 +312,7 @@ func TestCPCloudStackMachineValidateUpdateDiskOfferingMutableFailEmptyDevice(t *
312312
Label: "data_disk",
313313
}
314314
g := NewWithT(t)
315-
g.Expect(c.ValidateUpdate(ctx, c, &vOld)).Error().NotTo(Succeed())
315+
g.Expect(c.ValidateUpdate(ctx, &vOld, c)).Error().NotTo(Succeed())
316316
}
317317

318318
func TestCPCloudStackMachineValidateUpdateDiskOfferingMutableFailEmptyFilesystem(t *testing.T) {
@@ -340,7 +340,7 @@ func TestCPCloudStackMachineValidateUpdateDiskOfferingMutableFailEmptyFilesystem
340340
Label: "data_disk",
341341
}
342342
g := NewWithT(t)
343-
g.Expect(c.ValidateUpdate(ctx, c, &vOld)).Error().NotTo(Succeed())
343+
g.Expect(c.ValidateUpdate(ctx, &vOld, c)).Error().NotTo(Succeed())
344344
}
345345

346346
func TestCPCloudStackMachineValidateUpdateDiskOfferingMutableFailEmptyLabel(t *testing.T) {
@@ -368,7 +368,7 @@ func TestCPCloudStackMachineValidateUpdateDiskOfferingMutableFailEmptyLabel(t *t
368368
Label: "",
369369
}
370370
g := NewWithT(t)
371-
g.Expect(c.ValidateUpdate(ctx, c, &vOld)).Error().NotTo(Succeed())
371+
g.Expect(c.ValidateUpdate(ctx, &vOld, c)).Error().NotTo(Succeed())
372372
}
373373

374374
func TestCPCloudStackMachineValidateUpdateSymlinksMutable(t *testing.T) {
@@ -384,7 +384,7 @@ func TestCPCloudStackMachineValidateUpdateSymlinksMutable(t *testing.T) {
384384
"/var/log": "/data_2/var/log",
385385
}
386386
g := NewWithT(t)
387-
g.Expect(c.ValidateUpdate(ctx, c, &vOld)).Error().To(Succeed())
387+
g.Expect(c.ValidateUpdate(ctx, &vOld, c)).Error().To(Succeed())
388388
}
389389

390390
func TestCPCloudStackMachineValidateUpdateSymlinksMutableInvalidComma(t *testing.T) {
@@ -400,7 +400,7 @@ func TestCPCloudStackMachineValidateUpdateSymlinksMutableInvalidComma(t *testing
400400
"/var/log": "/data_2/var/log,d",
401401
}
402402
g := NewWithT(t)
403-
g.Expect(c.ValidateUpdate(ctx, c, &vOld)).Error().NotTo(Succeed())
403+
g.Expect(c.ValidateUpdate(ctx, &vOld, c)).Error().NotTo(Succeed())
404404
}
405405

406406
func TestCPCloudStackMachineValidateUpdateSymlinksMutableColon(t *testing.T) {
@@ -416,7 +416,7 @@ func TestCPCloudStackMachineValidateUpdateSymlinksMutableColon(t *testing.T) {
416416
"/var/log": "/data_2/var/log:d",
417417
}
418418
g := NewWithT(t)
419-
g.Expect(c.ValidateUpdate(ctx, c, &vOld)).Error().NotTo(Succeed())
419+
g.Expect(c.ValidateUpdate(ctx, &vOld, c)).Error().NotTo(Succeed())
420420
}
421421

422422
func TestWorkersCPCloudStackMachineValidateUpdateComputeOfferingMutable(t *testing.T) {
@@ -431,7 +431,7 @@ func TestWorkersCPCloudStackMachineValidateUpdateComputeOfferingMutable(t *testi
431431
Name: "newComputeOffering",
432432
}
433433
g := NewWithT(t)
434-
g.Expect(c.ValidateUpdate(ctx, c, &vOld)).Error().To(Succeed())
434+
g.Expect(c.ValidateUpdate(ctx, &vOld, c)).Error().To(Succeed())
435435
}
436436

437437
func TestWorkersCPCloudStackMachineValidateUpdateDiskOfferingMutable(t *testing.T) {
@@ -455,7 +455,7 @@ func TestWorkersCPCloudStackMachineValidateUpdateDiskOfferingMutable(t *testing.
455455
Label: "data_disk",
456456
}
457457
g := NewWithT(t)
458-
g.Expect(c.ValidateUpdate(ctx, c, &vOld)).Error().To(Succeed())
458+
g.Expect(c.ValidateUpdate(ctx, &vOld, c)).Error().To(Succeed())
459459
}
460460

461461
func TestManagementCloudStackMachineValidateUpdateSshAuthorizedKeyMutable(t *testing.T) {
@@ -469,7 +469,7 @@ func TestManagementCloudStackMachineValidateUpdateSshAuthorizedKeyMutable(t *tes
469469

470470
c.Spec.Users[0].SshAuthorizedKeys[0] = "rsa-laDeLala"
471471
g := NewWithT(t)
472-
g.Expect(c.ValidateUpdate(ctx, c, &vOld)).Error().To(Succeed())
472+
g.Expect(c.ValidateUpdate(ctx, &vOld, c)).Error().To(Succeed())
473473
}
474474

475475
func TestWorkloadCloudStackMachineValidateUpdateSshAuthorizedKeyMutable(t *testing.T) {
@@ -482,7 +482,7 @@ func TestWorkloadCloudStackMachineValidateUpdateSshAuthorizedKeyMutable(t *testi
482482

483483
c.Spec.Users[0].SshAuthorizedKeys[0] = "rsa-laDeLala"
484484
g := NewWithT(t)
485-
g.Expect(c.ValidateUpdate(ctx, c, &vOld)).Error().To(Succeed())
485+
g.Expect(c.ValidateUpdate(ctx, &vOld, c)).Error().To(Succeed())
486486
}
487487

488488
func TestWorkloadCloudStackMachineValidateUpdateSshUsernameMutable(t *testing.T) {
@@ -497,7 +497,7 @@ func TestWorkloadCloudStackMachineValidateUpdateSshUsernameMutable(t *testing.T)
497497

498498
c.Spec.Users[0].Name = "Andy"
499499
g := NewWithT(t)
500-
g.Expect(c.ValidateUpdate(ctx, c, &vOld)).Error().To(Succeed())
500+
g.Expect(c.ValidateUpdate(ctx, &vOld, c)).Error().To(Succeed())
501501
}
502502

503503
func TestWorkloadCloudStackMachineValidateUpdateInvalidUsers(t *testing.T) {
@@ -512,7 +512,7 @@ func TestWorkloadCloudStackMachineValidateUpdateInvalidUsers(t *testing.T) {
512512

513513
c.Spec.Users[0].Name = ""
514514
g := NewWithT(t)
515-
g.Expect(c.ValidateUpdate(ctx, c, &vOld)).Error().ToNot(Succeed())
515+
g.Expect(c.ValidateUpdate(ctx, &vOld, c)).Error().ToNot(Succeed())
516516
}
517517

518518
func TestCloudStackMachineValidateUpdateInvalidType(t *testing.T) {
@@ -521,7 +521,7 @@ func TestCloudStackMachineValidateUpdateInvalidType(t *testing.T) {
521521
c := &v1alpha1.CloudStackMachineConfig{}
522522

523523
g := NewWithT(t)
524-
g.Expect(c.ValidateUpdate(ctx, c, vOld)).Error().NotTo(Succeed())
524+
g.Expect(c.ValidateUpdate(ctx, vOld, c)).Error().NotTo(Succeed())
525525
}
526526

527527
func cloudstackMachineConfig() v1alpha1.CloudStackMachineConfig {
@@ -555,7 +555,7 @@ func TestCloudStackMachineValidateUpdateAffinityImmutable(t *testing.T) {
555555

556556
c.Spec.Affinity = "anti"
557557
g := NewWithT(t)
558-
g.Expect(c.ValidateUpdate(ctx, c, &vOld)).Error().ToNot(Succeed())
558+
g.Expect(c.ValidateUpdate(ctx, &vOld, c)).Error().ToNot(Succeed())
559559
}
560560

561561
func TestCloudStackMachineValidateUpdateAffinityGroupIdsImmutable(t *testing.T) {
@@ -567,11 +567,11 @@ func TestCloudStackMachineValidateUpdateAffinityGroupIdsImmutable(t *testing.T)
567567

568568
c.Spec.AffinityGroupIds = []string{}
569569
g := NewWithT(t)
570-
g.Expect(c.ValidateUpdate(ctx, c, &vOld)).Error().ToNot(Succeed())
570+
g.Expect(c.ValidateUpdate(ctx, &vOld, c)).Error().ToNot(Succeed())
571571

572572
c.Spec.AffinityGroupIds = []string{"affinity-group-2"}
573573
g = NewWithT(t)
574-
g.Expect(c.ValidateUpdate(ctx, c, &vOld)).Error().ToNot(Succeed())
574+
g.Expect(c.ValidateUpdate(ctx, &vOld, c)).Error().ToNot(Succeed())
575575
}
576576

577577
func TestCloudStackMachineConfigValidateCreateCastFail(t *testing.T) {

pkg/api/v1alpha1/cluster_webhook.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ func (r *Cluster) ValidateCreate(_ context.Context, obj runtime.Object) (admissi
9797
}
9898

9999
// ValidateUpdate implements webhook.CustomValidator so a webhook will be registered for the type.
100-
func (r *Cluster) ValidateUpdate(_ context.Context, obj, old runtime.Object) (admission.Warnings, error) {
100+
func (r *Cluster) ValidateUpdate(_ context.Context, old, obj runtime.Object) (admission.Warnings, error) {
101101
newCluster, ok := obj.(*Cluster)
102102
if !ok {
103103
return nil, fmt.Errorf("expected a Cluster but got %T", obj)

0 commit comments

Comments
 (0)