Skip to content

Bump controller-runtime to v0.24.1 and k8s.io/* to v0.36.2 - #7120

Open
mytreya-rh wants to merge 2 commits into
operator-framework:masterfrom
mytreya-rh:bump-controller-runtime-v0.24.1
Open

Bump controller-runtime to v0.24.1 and k8s.io/* to v0.36.2#7120
mytreya-rh wants to merge 2 commits into
operator-framework:masterfrom
mytreya-rh:bump-controller-runtime-v0.24.1

Conversation

@mytreya-rh

Copy link
Copy Markdown

Summary

Routine dependency bump, no feature content:

  • sigs.k8s.io/controller-runtime v0.21.0 -> v0.24.1
  • k8s.io/api, k8s.io/apiextensions-apiserver, k8s.io/apimachinery, k8s.io/cli-runtime, k8s.io/client-go, k8s.io/kubectl v0.33.9 -> v0.36.2
  • transitive dependency updates picked up by go mod tidy && go mod vendor

This unblocks downstream distributions (e.g. OpenShift) that want to build the helm-operator against packages requiring newer controller-runtime/k8s.io APIs - for example github.com/openshift/controller-runtime-common/pkg/tls, which requires controller-runtime >= v0.22.5, used to read a cluster's centralized TLS security profile and apply it to the metrics server.

Changes

  • go.mod/go.sum/vendor/ updated via go get + go mod tidy + go mod vendor.
  • internal/olm/client/client_test.go: the errClient test double needs a new Apply method to satisfy client.Client, since client.Writer gained an Apply method in this controller-runtime version range.

Test plan

  • go build ./..., go vet ./... pass.
  • go test ./... passes, aside from test/e2e/* and test/integration, which require a live cluster and are unaffected by this change (they fail the same way against master in a sandboxed/offline environment).

Made with Cursor

Bumps sigs.k8s.io/controller-runtime v0.21.0 -> v0.24.1 and
k8s.io/{api,apiextensions-apiserver,apimachinery,cli-runtime,client-go,kubectl}
v0.33.9 -> v0.36.2, plus transitive dependency updates picked up by
`go mod tidy`.

This is a routine dependency bump with no feature content. It's a
prerequisite for downstream distributions that want to adopt
github.com/openshift/controller-runtime-common/pkg/tls (which requires
controller-runtime >= v0.22.5) or similar packages built against newer
controller-runtime/k8s.io APIs.

Also fixes fallout the bump surfaces:
- internal/olm/client/client_test.go's errClient test double needs a new
  Apply method to satisfy controller-runtime's client.Client interface
  (client.Writer gained Apply in this version range).
- internal/helm/controller/controller.go:65 and
  internal/olm/operator/uninstall.go:198 are pre-existing call sites that
  `make test-sanity`'s golangci-lint now flags as SA1019 (deprecated),
  because the bump changes what staticcheck can see as deprecated:
  controller-runtime's GetEventRecorderFor is newly deprecated in this
  version range (it wasn't in v0.21.0), and k8s.io/kubectl's
  slice.ContainsString was already deprecated in v0.33.9 but its doc
  comment didn't follow the convention staticcheck requires until v0.36.2
  reformatted it. slice.ContainsString is swapped for the stdlib
  slices.Contains (identical behavior, no modifier func was used);
  GetEventRecorderFor is left as-is with a //nolint:staticcheck (matching
  controller-runtime's own internal usage) since migrating
  HelmOperatorReconciler off the old events API is a larger, unrelated
  change.

Co-authored-by: Cursor <cursoragent@cursor.com>
@mytreya-rh
mytreya-rh force-pushed the bump-controller-runtime-v0.24.1 branch from 5582c29 to c54567c Compare August 14, 2026 06:59
The prior commit left HelmOperatorReconciler.EventRecorder on the
deprecated Manager.GetEventRecorderFor/record.EventRecorder pair,
suppressed with a //nolint:staticcheck, calling the full migration a
larger, unrelated change. Do that migration now, as its own commit, so
staticcheck (SA1019) stays clean without a nolint annotation.

Switch HelmOperatorReconciler.EventRecorder to
k8s.io/client-go/tools/events.EventRecorder (populated via the new
Manager.GetEventRecorder) and update both Eventf call sites to the new
signature: Eventf(regarding, related, eventtype, reason, action, note,
args...). The related object is always nil here since there's no
separate related object modeled for override-value events. The reason
string ("OverrideValuesInUse") is reused as the action value since this
code doesn't otherwise model a distinct action; happy to adjust if
maintainers prefer a different action string.

No go.mod/go.sum/vendor changes: k8s.io/client-go/tools/events is
already a transitive dependency via controller-runtime's
Manager.GetEventRecorder.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant