Skip to content

chore: bump controller-runtime to v0.23.3 and migrate DiscoveredCluster webhook - #2360

Open
manusa wants to merge 1 commit into
stolostron:mainfrom
manusa:controller-runtime-0.23-webhooks
Open

chore: bump controller-runtime to v0.23.3 and migrate DiscoveredCluster webhook#2360
manusa wants to merge 1 commit into
stolostron:mainfrom
manusa:controller-runtime-0.23-webhooks

Conversation

@manusa

@manusa manusa commented Sep 14, 2026

Copy link
Copy Markdown

Description

Moves the DiscoveredCluster webhook to the typed admission API so controller-runtime can be upgraded again.

discovery is still on controller-runtime v0.19.4. The Konflux bumps to v0.23/v0.24 (#1582, #1912, #2056, #2201) couldn't merge because api/v1/discovery_webhook.go uses webhook.Defaulter/webhook.Validator (removed in v0.20) and the untyped ctrl.NewWebhookManagedBy(mgr).For(r) builder (replaced in v0.23).

It also affects consumers of the API package: anything importing github.com/stolostron/discovery/api/v1 with controller-runtime >= v0.20 fails to compile. In fabric8io/kubernetes-client it's the last thing keeping our model generator off the Kubernetes 1.37 libraries.

The approach is the same as stolostron/backplane-operator#3153.

Related Issue

None filed, context above.

Changes Made

  • controller-runtime v0.19.4 → v0.23.3, which matches the k8s.io v0.35 libraries already in use
  • DiscoveredCluster webhook uses builder.WebhookManagedBy(mgr, r) with typed admission.Defaulter/admission.Validator; validation logic is unchanged
  • Unit tests for Default, ValidateCreate, ValidateUpdate and ValidateDelete
  • setup-envtest release-0.17 → release-0.23 and ENVTEST_K8S_VERSION 1.25 → 1.35.0; dropped --use-deprecated-gcs, which release-0.23 no longer accepts
  • zz_generated.deepcopy.go as regenerated by make generate

Checklist

  • I have tested the changes locally: make test (including the envtest controllers suite), go vet ./..., make generate manifests
  • I have added/updated relevant unit tests (if applicable).

Additional Notes

With this change api/v1 also builds against controller-runtime v0.25.1 and k8s.io v0.37.0, which downstream consumers such as fabric8io/kubernetes-client need.

Reviewers

/cc @dislbenn

…er webhook

controller-runtime v0.20 removed webhook.Defaulter/webhook.Validator and
v0.23 replaced the untyped NewWebhookManagedBy(mgr).For(obj) builder, so
the DiscoveredCluster webhook moves to builder.WebhookManagedBy(mgr, obj)
with the typed admission.Defaulter/admission.Validator interfaces, as
done in stolostron/backplane-operator#3153. Validation behavior is
unchanged and now covered by unit tests.

setup-envtest moves to release-0.23 (Kubernetes 1.35.0 assets), which no
longer accepts --use-deprecated-gcs.

Signed-off-by: Marc Nuri <marc@marcnuri.com>
@coderabbitai

coderabbitai Bot commented Sep 14, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: a4ec4799-3612-44c7-89dd-bee5503f9c24


Comment @coderabbitai help to get the list of available commands.

@openshift-ci

openshift-ci Bot commented Sep 14, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: manusa
Once this PR has been reviewed and has the lgtm label, please assign dislbenn for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci

openshift-ci Bot commented Sep 14, 2026

Copy link
Copy Markdown

Hi @manusa. Thanks for your PR.

I'm waiting for a stolostron member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant