Skip to content

Decouple conversion webhook registration from leader election - #357

Merged
ulucinar merged 1 commit into
crossplane-contrib:mainfrom
ulucinar:unconditional-webhooks
Jul 29, 2026
Merged

Decouple conversion webhook registration from leader election#357
ulucinar merged 1 commit into
crossplane-contrib:mainfrom
ulucinar:unconditional-webhooks

Conversation

@ulucinar

@ulucinar ulucinar commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

Description of your changes

Related PRs: crossplane-contrib/provider-upjet-aws#2122

Applies the upjet template fix for the conversion webhook / leader election bug to this provider. It also bumps upjet to v2.3.0.

  • cmd/provider/main.go: removes StartWebhooks from both opts structs; adds an explicit startWebhooks block before the canSafeStart gate that calls SetupWebhookWithManager for both cluster-scoped and namespaced controllers. A comment at the call site explains why webhook registration must happen here rather than inside the gate.

  • config/templates/controller.go.tmpl: mirrors the upjet template change — adds SetupWebhookWithManager, removes the if o.StartWebhooks { ... } block from Setup.

I have:

  • Read and followed Crossplane's contribution process.
  • Run make reviewable to ensure this PR is ready for review.

How has this code been tested

- Bump github.com/crossplane/upjet/v2 to v2.3.0, whose setup aggregator
  template emits SetupWebhookWithManager.

Signed-off-by: Alper Rifat Ulucinar <ulucinar@users.noreply.github.com>
@ulucinar

Copy link
Copy Markdown
Collaborator Author

/test-examples="examples/cluster/applications/v1beta2/application.yaml"

@erhancagirici erhancagirici left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @ulucinar, LGTM

@ulucinar
ulucinar merged commit 00f21b5 into crossplane-contrib:main Jul 29, 2026
9 checks passed
@ulucinar
ulucinar deleted the unconditional-webhooks branch July 29, 2026 07:50
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.

2 participants