Skip to content

Commit 4107889

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 4107889

28 files changed

+331
-725
lines changed

.github/workflows/test.yml

Lines changed: 14 additions & 14 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,10 +91,10 @@ 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
@@ -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

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

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)

controllers/generic_network_controller.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ import (
4040
"github.com/k8snetworkplumbingwg/sriov-network-operator/pkg/vars"
4141
)
4242

43-
type networkCRInstance interface {
43+
type NetworkCRInstance interface {
4444
client.Object
4545
// renders NetAttDef from the network instance
4646
RenderNetAttDef() (*uns.Unstructured, error)
@@ -53,7 +53,7 @@ type networkController interface {
5353
reconcile.Reconciler
5454
// GetObject should return CR type which implements networkCRInstance
5555
// interface
56-
GetObject() networkCRInstance
56+
GetObject() NetworkCRInstance
5757
// should return CR list type
5858
GetObjectList() client.ObjectList
5959
// should return name of the controller
@@ -207,7 +207,7 @@ func (r *genericNetworkReconciler) SetupWithManager(mgr ctrl.Manager) error {
207207
Complete(r.controller)
208208
}
209209

210-
func (r *genericNetworkReconciler) namespaceHandlerCreate(ctx context.Context, e event.CreateEvent, q workqueue.RateLimitingInterface) {
210+
func (r *genericNetworkReconciler) namespaceHandlerCreate(ctx context.Context, e event.TypedCreateEvent[client.Object], w workqueue.TypedRateLimitingInterface[reconcile.Request]) {
211211
networkList := r.controller.GetObjectList()
212212
err := r.List(ctx,
213213
networkList,
@@ -227,7 +227,7 @@ func (r *genericNetworkReconciler) namespaceHandlerCreate(ctx context.Context, e
227227
unsList.SetUnstructuredContent(unsContent)
228228
_ = unsList.EachListItem(func(o runtime.Object) error {
229229
unsObj := o.(*uns.Unstructured)
230-
q.Add(reconcile.Request{NamespacedName: types.NamespacedName{
230+
w.Add(reconcile.Request{NamespacedName: types.NamespacedName{
231231
Namespace: unsObj.GetNamespace(),
232232
Name: unsObj.GetName(),
233233
}})
@@ -236,7 +236,7 @@ func (r *genericNetworkReconciler) namespaceHandlerCreate(ctx context.Context, e
236236
}
237237

238238
// deleteNetAttDef deletes the generated net-att-def CR
239-
func (r *genericNetworkReconciler) deleteNetAttDef(ctx context.Context, cr networkCRInstance) error {
239+
func (r *genericNetworkReconciler) deleteNetAttDef(ctx context.Context, cr NetworkCRInstance) error {
240240
// Fetch the NetworkAttachmentDefinition instance
241241
namespace := cr.NetworkNamespace()
242242
if namespace == "" {

controllers/ovsnetwork_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ func (r *OVSNetworkReconciler) Name() string {
4848
}
4949

5050
// return empty instance of the OVSNetwork CR
51-
func (r *OVSNetworkReconciler) GetObject() networkCRInstance {
51+
func (r *OVSNetworkReconciler) GetObject() NetworkCRInstance {
5252
return &sriovnetworkv1.OVSNetwork{}
5353
}
5454

0 commit comments

Comments
 (0)