Skip to content

Commit b442919

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

File tree

5 files changed

+15
-13
lines changed

5 files changed

+15
-13
lines changed

.github/workflows/golangci-lint.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@ jobs:
1111
name: lint
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@v3
15-
- uses: actions/setup-go@v3
14+
- uses: actions/checkout@v4
15+
- uses: actions/setup-go@v5
1616
with:
17-
go-version: '1.22'
17+
go-version: '1.23'
1818
check-latest: true
1919
cache: true
2020
- name: golangci-lint
21-
uses: golangci/golangci-lint-action@v3
21+
uses: golangci/golangci-lint-action@v8
2222
with:
23-
version: v1.55.2
24-
# Disable package caching to avoid a double cache with setup-go.
25-
skip-pkg-cache: true
23+
version: v2.1.0
24+
only-new-issues: true
2625
args: --timeout 10m
26+

.github/workflows/vulnerability.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
with:
2222
show-progress: false
2323
- name: "Dependency Review"
24-
uses: actions/dependency-review-action@v3
24+
uses: actions/dependency-review-action@v4
2525
with:
2626
base-ref: ${{ github.event.pull_request.base.sha || github.event.before || github.sha }}
2727
head-ref: ${{ github.event.pull_request.head.sha || github.sha }}

.golangci.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1+
version: "2"
12
run:
23
timeout: 10m
3-
skip-dirs:
4-
- "api/v1alpha3"
4+
exclusions:
5+
paths:
6+
- api/v1alpha3

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)