Skip to content

Upgrade sigs.k8s.io/controller-runtime to v0.23.3#264

Open
felix-kaestner wants to merge 1 commit intomainfrom
bump/controller-runtime-v0.23
Open

Upgrade sigs.k8s.io/controller-runtime to v0.23.3#264
felix-kaestner wants to merge 1 commit intomainfrom
bump/controller-runtime-v0.23

Conversation

@felix-kaestner
Copy link
Copy Markdown
Contributor

@felix-kaestner felix-kaestner commented Mar 27, 2026

Breaking changes addressed

Priority queue now default (kubernetes-sigs/controller-runtime#3332)

  • Drop explicit UsePriorityQueue: new(true) in cmd/main.go — no-op now

Generic Validator/Defaulter webhook API (kubernetes-sigs/controller-runtime#3360)

  • ctrl.NewWebhookManagedBy(mgr).For(&T{})ctrl.NewWebhookManagedBy(mgr, &T{})
  • Webhook validators migrated from deprecated admission.CustomValidator (with runtime.Object method signatures) to typed admission.Validator[T] (with concrete type signatures), eliminating type assertion boilerplate
  • Remove now-impossible "wrong type" test cases in NVE and NVEConfig webhooks

Migration to new events API (kubernetes-sigs/controller-runtime#3262)

  • mgr.GetEventRecorderFor(name)mgr.GetEventRecorder(name) in cmd/main.go
  • All controllers and provisioning server: k8s.io/client-go/tools/record.EventRecorderk8s.io/client-go/tools/events.EventRecorder
  • Call sites updated: recorder.Event(obj, type, reason, msg)recorder.Eventf(obj, nil, type, reason, reason, msg) (new API adds related object and action fields)
  • Tests: record.NewFakeRecorderevents.NewFakeRecorder

@felix-kaestner felix-kaestner requested a review from a team as a code owner March 27, 2026 17:14
@felix-kaestner felix-kaestner force-pushed the bump/controller-runtime-v0.23 branch from d358241 to 6bccde7 Compare March 27, 2026 17:15
The priority queue is now enabled by default
(kubernetes-sigs/controller-runtime#3332), so the explicit
UsePriorityQueue: new(true) in cmd/main.go is dropped.

The webhook builder API changed to a generic form
(kubernetes-sigs/controller-runtime#3360).
NewWebhookManagedBy(mgr).For(&T{}) is replaced by
NewWebhookManagedBy(mgr, &T{}). Validators are migrated from the
deprecated CustomValidator interface with runtime.Object signatures
to the typed Validator[T] interface with concrete types, removing
the type assertion boilerplate. Test cases for wrong-object-type
errors are removed as they are no longer expressible at runtime.

The events API changed from k8s.io/client-go/tools/record to
k8s.io/client-go/tools/events (kubernetes-sigs/controller-runtime#3262).
GetEventRecorderFor is replaced by GetEventRecorder. All controllers
and the provisioning server are updated accordingly, and call sites
are updated to the new Eventf signature which adds related object
and action fields. Tests use the new events.NewFakeRecorder.
@felix-kaestner felix-kaestner force-pushed the bump/controller-runtime-v0.23 branch from 6bccde7 to 3080f4f Compare March 27, 2026 17:23
@github-actions
Copy link
Copy Markdown

Merging this branch will increase overall coverage

Impacted Packages Coverage Δ 🤖
github.com/ironcore-dev/network-operator/cmd 0.00% (ø)
github.com/ironcore-dev/network-operator/internal/controller/cisco/nx 63.29% (ø)
github.com/ironcore-dev/network-operator/internal/controller/core 63.30% (+0.46%) 👍
github.com/ironcore-dev/network-operator/internal/provisioning 76.15% (ø)
github.com/ironcore-dev/network-operator/internal/webhook/cisco/nx/v1alpha1 93.10% (+3.63%) 👍
github.com/ironcore-dev/network-operator/internal/webhook/core/v1alpha1 95.83% (+5.36%) 👍

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/ironcore-dev/network-operator/cmd/main.go 0.00% (ø) 0 0 0
github.com/ironcore-dev/network-operator/internal/controller/cisco/nx/bordergateway_controller.go 52.14% (ø) 234 122 112
github.com/ironcore-dev/network-operator/internal/controller/cisco/nx/system_controller.go 64.04% (ø) 114 73 41
github.com/ironcore-dev/network-operator/internal/controller/cisco/nx/vpcdomain_controller.go 74.55% (ø) 224 167 57
github.com/ironcore-dev/network-operator/internal/controller/core/acl_controller.go 58.99% (ø) 139 82 57
github.com/ironcore-dev/network-operator/internal/controller/core/banner_controller.go 58.68% (ø) 167 98 69
github.com/ironcore-dev/network-operator/internal/controller/core/bgp_controller.go 58.99% (ø) 139 82 57
github.com/ironcore-dev/network-operator/internal/controller/core/bgp_peer_controller.go 65.34% (ø) 176 115 61
github.com/ironcore-dev/network-operator/internal/controller/core/certificate_controller.go 58.82% (ø) 153 90 63
github.com/ironcore-dev/network-operator/internal/controller/core/device_controller.go 65.52% (ø) 203 133 70
github.com/ironcore-dev/network-operator/internal/controller/core/dns_controller.go 58.82% (ø) 136 80 56
github.com/ironcore-dev/network-operator/internal/controller/core/evpninstance_controller.go 67.96% (+3.88%) 206 140 (+8) 66 (-8) 👍
github.com/ironcore-dev/network-operator/internal/controller/core/interface_controller.go 75.19% (+2.05%) 391 294 (+8) 97 (-8) 👍
github.com/ironcore-dev/network-operator/internal/controller/core/isis_controller.go 60.78% (ø) 153 93 60
github.com/ironcore-dev/network-operator/internal/controller/core/lldp_controller.go 67.98% (ø) 203 138 65
github.com/ironcore-dev/network-operator/internal/controller/core/managementaccess_controller.go 58.82% (ø) 136 80 56
github.com/ironcore-dev/network-operator/internal/controller/core/ntp_controller.go 58.82% (ø) 136 80 56
github.com/ironcore-dev/network-operator/internal/controller/core/nve_controller.go 67.43% (ø) 218 147 71
github.com/ironcore-dev/network-operator/internal/controller/core/ospf_controller.go 59.34% (ø) 182 108 74
github.com/ironcore-dev/network-operator/internal/controller/core/pim_controller.go 60.78% (ø) 153 93 60
github.com/ironcore-dev/network-operator/internal/controller/core/prefixset_controller.go 62.59% (ø) 139 87 52
github.com/ironcore-dev/network-operator/internal/controller/core/routingpolicy_controller.go 65.61% (ø) 189 124 65
github.com/ironcore-dev/network-operator/internal/controller/core/snmp_controller.go 58.82% (ø) 136 80 56
github.com/ironcore-dev/network-operator/internal/controller/core/syslog_controller.go 58.99% (ø) 139 82 57
github.com/ironcore-dev/network-operator/internal/controller/core/user_controller.go 57.49% (+1.20%) 167 96 (+2) 71 (-2) 👍
github.com/ironcore-dev/network-operator/internal/controller/core/vlan_controller.go 61.74% (ø) 149 92 57
github.com/ironcore-dev/network-operator/internal/controller/core/vrf_controller.go 61.70% (ø) 141 87 54
github.com/ironcore-dev/network-operator/internal/provisioning/http.go 76.15% (ø) 239 182 57
github.com/ironcore-dev/network-operator/internal/webhook/cisco/nx/v1alpha1/nveconfig_webhook.go 93.10% (+3.63%) 29 (-9) 27 (-7) 2 (-2) 👍
github.com/ironcore-dev/network-operator/internal/webhook/core/v1alpha1/bgp_webhook.go 90.91% (+3.73%) 33 (-6) 30 (-4) 3 (-2) 👍
github.com/ironcore-dev/network-operator/internal/webhook/core/v1alpha1/bgppeer_webhook.go 83.33% (+8.33%) 6 (-6) 5 (-4) 1 (-2) 👍
github.com/ironcore-dev/network-operator/internal/webhook/core/v1alpha1/interface_webhook.go 97.56% (+3.94%) 41 (-6) 40 (-4) 1 (-2) 👍
github.com/ironcore-dev/network-operator/internal/webhook/core/v1alpha1/nve_webhook.go 100.00% (+6.90%) 20 (-9) 20 (-7) 0 (-2) 👍
github.com/ironcore-dev/network-operator/internal/webhook/core/v1alpha1/prefixset_webhook.go 96.88% (+6.63%) 32 (-9) 31 (-6) 1 (-3) 👍
github.com/ironcore-dev/network-operator/internal/webhook/core/v1alpha1/vrf_webhook.go 97.22% (+4.37%) 36 (-6) 35 (-4) 1 (-2) 👍

Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code.

Changed unit test files

  • github.com/ironcore-dev/network-operator/internal/controller/cisco/nx/suite_test.go
  • github.com/ironcore-dev/network-operator/internal/controller/core/suite_test.go
  • github.com/ironcore-dev/network-operator/internal/provisioning/http_test.go
  • github.com/ironcore-dev/network-operator/internal/webhook/cisco/nx/v1alpha1/nveconfig_webhook_test.go
  • github.com/ironcore-dev/network-operator/internal/webhook/core/v1alpha1/nve_webhook_test.go

@hardikdr hardikdr added the area/switch-automation Automation processes for network switch management and operations. label Mar 28, 2026
@hardikdr hardikdr added this to Roadmap Mar 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/switch-automation Automation processes for network switch management and operations.

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants