Skip to content

Commit bfc2e10

Browse files
committed
Fix webhook interface method validateUpdate args
1 parent f8ff0ab commit bfc2e10

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

.github/workflows/golangci-lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
- uses: actions/checkout@v3
1515
- uses: actions/setup-go@v3
1616
with:
17-
go-version: '1.22'
17+
go-version: '1.23'
1818
check-latest: true
1919
cache: true
2020
- name: golangci-lint

api/v1beta1/etcdadmcluster_webhook.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ func (r *EtcdadmCluster) ValidateCreate(_ context.Context, obj runtime.Object) (
8686
}
8787

8888
// ValidateUpdate implements webhook.CustomValidator so a webhook will be registered for the type
89-
func (r *EtcdadmCluster) ValidateUpdate(_ context.Context, obj, old runtime.Object) (admission.Warnings, error) {
89+
func (r *EtcdadmCluster) ValidateUpdate(_ context.Context, old, obj runtime.Object) (admission.Warnings, error) {
9090
etcdadmCluster, ok := obj.(*EtcdadmCluster)
9191
if !ok {
9292
return nil, fmt.Errorf("expected an EtcdadmCluster but got %T", obj)
@@ -153,4 +153,4 @@ func (r *EtcdadmCluster) validateCommon() (allErrs field.ErrorList) {
153153
}
154154

155155
return allErrs
156-
}
156+
}

api/v1beta1/etcdadmcluster_webhook_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ func TestEtcdadmClusterValidateUpdateCastFail(t *testing.T) {
6969
config := &EtcdadmCluster{}
7070

7171
// Call ValidateUpdate with the wrong type
72-
warnings, err := config.ValidateUpdate(context.TODO(), wrongType, &EtcdadmCluster{})
72+
warnings, err := config.ValidateUpdate(context.TODO(), &EtcdadmCluster{}, wrongType)
7373

7474
// Verify that an error is returned
7575
g.Expect(warnings).To(BeNil())

0 commit comments

Comments
 (0)