Skip to content

Commit 09ae4c0

Browse files
committed
Bump controller-runtime and kubernetes
Controller-runtime version v0.20.2 Kubernetes version v1.32.1 Signed-off-by: Sebastian Sch <sebassch@gmail.com>
1 parent ab7d367 commit 09ae4c0

30 files changed

+341
-735
lines changed

.github/workflows/test.yml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ jobs:
1313
runs-on: ubuntu-latest
1414
steps:
1515

16-
- name: Set up Go 1.22
16+
- name: Set up Go 1.23
1717
uses: actions/setup-go@v3
1818
with:
19-
go-version: 1.22.x
19+
go-version: 1.23.x
2020

2121
- name: Check out code into the Go module directory
2222
uses: actions/checkout@v2
@@ -32,10 +32,10 @@ jobs:
3232
runs-on: ubuntu-latest
3333
steps:
3434

35-
- name: Set up Go 1.22
35+
- name: Set up Go 1.23
3636
uses: actions/setup-go@v2
3737
with:
38-
go-version: 1.22.x
38+
go-version: 1.23.x
3939

4040
- name: Check out code into the Go module directory
4141
uses: actions/checkout@v2
@@ -66,10 +66,10 @@ jobs:
6666
runs-on: ubuntu-latest
6767
steps:
6868

69-
- name: Set up Go 1.22
69+
- name: Set up Go 1.23
7070
uses: actions/setup-go@v2
7171
with:
72-
go-version: 1.22.x
72+
go-version: 1.23.x
7373

7474
- name: Check out code into the Go module directory
7575
uses: actions/checkout@v2
@@ -91,17 +91,17 @@ jobs:
9191
name: Golangci-lint
9292
runs-on: ubuntu-latest
9393
steps:
94-
- name: Set up Go 1.22
94+
- name: Set up Go 1.23
9595
uses: actions/setup-go@v2
9696
with:
97-
go-version: 1.22.x
97+
go-version: 1.23.x
9898
- name: Check out code into the Go module directory
9999
uses: actions/checkout@v2
100100
- name: golangci-lint
101101
uses: golangci/golangci-lint-action@v3
102102
with:
103103
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
104-
version: v1.55.2
104+
version: v1.64.6
105105

106106
shellcheck:
107107
name: Shellcheck
@@ -118,10 +118,10 @@ jobs:
118118
runs-on: ubuntu-latest
119119
steps:
120120

121-
- name: Set up Go 1.22
121+
- name: Set up Go 1.23
122122
uses: actions/setup-go@v2
123123
with:
124-
go-version: 1.22.x
124+
go-version: 1.23.x
125125

126126
- name: Check out code into the Go module directory
127127
uses: actions/checkout@v2
@@ -161,10 +161,10 @@ jobs:
161161
- name: Check out code into the Go module directory
162162
uses: actions/checkout@v2
163163

164-
- name: Set up Go 1.22
164+
- name: Set up Go 1.23
165165
uses: actions/setup-go@v3
166166
with:
167-
go-version: 1.22.x
167+
go-version: 1.23.x
168168

169169
- name: run test
170170
run: make test-e2e-conformance-virtual-k8s-cluster-ci
@@ -195,10 +195,10 @@ jobs:
195195
- name: Check out code into the Go module directory
196196
uses: actions/checkout@v2
197197

198-
- name: Set up Go 1.22
198+
- name: Set up Go 1.23
199199
uses: actions/setup-go@v3
200200
with:
201-
go-version: 1.22.x
201+
go-version: 1.23.x
202202

203203
- name: run test
204204
run: make test-e2e-conformance-virtual-ocp-cluster-ci

.golangci.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
11
# Tested with golangci-lint ver. 1.37
22
run:
33
timeout: 10m
4-
skip-dirs:
5-
- vendor/
6-
- .github/
7-
- deployment/
8-
- doc/
9-
- bindata/
10-
- pkg/client
114
linters-settings:
125
depguard:
136
rules:
@@ -78,7 +71,6 @@ linters:
7871
- dogsled
7972
# TODO fix issues- dupl
8073
# TODO fix issues- errcheck
81-
- exportloopref
8274
- exhaustive
8375
# TODO fix issues- funlen
8476
#- gochecknoinits
@@ -105,9 +97,17 @@ linters:
10597
# TODO fix issues- unparam
10698
- unused
10799
- whitespace
100+
- copyloopvar
108101

109102
issues:
110103
# Excluding configuration per-path, per-linter, per-text and per-source
104+
exclude-dirs:
105+
- vendor/
106+
- .github/
107+
- deployment/
108+
- doc/
109+
- bindata/
110+
- pkg/client
111111
exclude-rules:
112112
- path: _test\.go
113113
linters:

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.22 AS builder
1+
FROM golang:1.23 AS builder
22
WORKDIR /go/src/github.com/k8snetworkplumbingwg/sriov-network-operator
33
COPY . .
44
RUN make _build-manager BIN_PATH=build/_output/cmd

Dockerfile.sriov-network-config-daemon

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.22 AS builder
1+
FROM golang:1.23 AS builder
22
WORKDIR /go/src/github.com/k8snetworkplumbingwg/sriov-network-operator
33
COPY . .
44
RUN make _build-sriov-network-config-daemon BIN_PATH=build/_output/cmd

Dockerfile.webhook

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.22 AS builder
1+
FROM golang:1.23 AS builder
22
WORKDIR /go/src/github.com/k8snetworkplumbingwg/sriov-network-operator
33
COPY . .
44
RUN make _build-webhook BIN_PATH=build/_output/cmd

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ GOLANGCI_LINT = $(BIN_DIR)/golangci-lint
5353
# golangci-lint version should be updated periodically
5454
# we keep it fixed to avoid it from unexpectedly failing on the project
5555
# in case of a version bump
56-
GOLANGCI_LINT_VER = v1.55.2
56+
GOLANGCI_LINT_VER = v1.64.6
5757

5858

5959
.PHONY: all build clean gendeepcopy test test-e2e test-e2e-k8s run image fmt sync-manifests test-e2e-conformance manifests update-codegen

cmd/sriov-network-config-daemon/start.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import (
2121
"net/url"
2222
"os"
2323
"strings"
24-
"time"
2524

2625
ocpconfigapi "github.com/openshift/api/config/v1"
2726
"github.com/spf13/cobra"
@@ -229,7 +228,6 @@ func runStartCmd(cmd *cobra.Command, args []string) error {
229228
return err
230229
}
231230
vars.Config = config
232-
config.Timeout = 5 * time.Second
233231

234232
// create helpers
235233
hostHelpers, err := helper.NewDefaultHostHelpers()

config/crd/bases/sriovnetwork.openshift.io_sriovnetworkpoolconfigs.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,13 @@ spec:
8383
items:
8484
type: string
8585
type: array
86+
x-kubernetes-list-type: atomic
8687
required:
8788
- key
8889
- operator
8990
type: object
9091
type: array
92+
x-kubernetes-list-type: atomic
9193
matchLabels:
9294
additionalProperties:
9395
type: string

controllers/drain_controller.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -190,14 +190,14 @@ func (dr *DrainReconcile) ensureAnnotationExists(ctx context.Context, object cli
190190
// SetupWithManager sets up the controller with the Manager.
191191
func (dr *DrainReconcile) SetupWithManager(mgr ctrl.Manager) error {
192192
createUpdateEnqueue := handler.Funcs{
193-
CreateFunc: func(ctx context.Context, e event.CreateEvent, q workqueue.RateLimitingInterface) {
194-
q.Add(reconcile.Request{NamespacedName: types.NamespacedName{
193+
CreateFunc: func(c context.Context, e event.TypedCreateEvent[client.Object], w workqueue.TypedRateLimitingInterface[reconcile.Request]) {
194+
w.Add(reconcile.Request{NamespacedName: types.NamespacedName{
195195
Namespace: vars.Namespace,
196196
Name: e.Object.GetName(),
197197
}})
198198
},
199-
UpdateFunc: func(ctx context.Context, e event.UpdateEvent, q workqueue.RateLimitingInterface) {
200-
q.Add(reconcile.Request{NamespacedName: types.NamespacedName{
199+
UpdateFunc: func(ctx context.Context, e event.TypedUpdateEvent[client.Object], w workqueue.TypedRateLimitingInterface[reconcile.Request]) {
200+
w.Add(reconcile.Request{NamespacedName: types.NamespacedName{
201201
Namespace: vars.Namespace,
202202
Name: e.ObjectNew.GetName(),
203203
}})

controllers/drain_controller_test.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import (
1717
"k8s.io/utils/pointer"
1818
"sigs.k8s.io/controller-runtime/pkg/client"
1919

20-
mcfgv1 "github.com/openshift/machine-config-operator/pkg/apis/machineconfiguration.openshift.io/v1"
20+
mcfgv1 "github.com/openshift/api/machineconfiguration/v1"
2121

2222
sriovnetworkv1 "github.com/k8snetworkplumbingwg/sriov-network-operator/api/v1"
2323
constants "github.com/k8snetworkplumbingwg/sriov-network-operator/pkg/consts"
@@ -90,8 +90,9 @@ var _ = Describe("Drain Controller", Ordered, func() {
9090
})
9191

9292
BeforeEach(func() {
93-
Expect(k8sClient.DeleteAllOf(context.Background(), &corev1.Node{})).ToNot(HaveOccurred())
94-
Expect(k8sClient.DeleteAllOf(context.Background(), &sriovnetworkv1.SriovNetworkNodeState{}, client.InNamespace(vars.Namespace))).ToNot(HaveOccurred())
93+
Expect(k8sClient.DeleteAllOf(context.Background(), &corev1.Node{}, &client.DeleteAllOfOptions{DeleteOptions: client.DeleteOptions{GracePeriodSeconds: pointer.Int64(0)}})).ToNot(HaveOccurred())
94+
Expect(k8sClient.DeleteAllOf(context.Background(), &sriovnetworkv1.SriovNetworkNodeState{}, client.InNamespace(vars.Namespace), &client.DeleteAllOfOptions{DeleteOptions: client.DeleteOptions{GracePeriodSeconds: pointer.Int64(0)}})).ToNot(HaveOccurred())
95+
Expect(k8sClient.DeleteAllOf(context.Background(), &corev1.Pod{}, client.InNamespace(testNamespace), &client.DeleteAllOfOptions{DeleteOptions: client.DeleteOptions{GracePeriodSeconds: pointer.Int64(0)}})).ToNot(HaveOccurred())
9596

9697
poolConfig := &sriovnetworkv1.SriovNetworkPoolConfig{}
9798
poolConfig.SetNamespace(testNamespace)

0 commit comments

Comments
 (0)