-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🐛 (go/v4) resolve duplicate webhook name issue in multi-version API #4145
🐛 (go/v4) resolve duplicate webhook name issue in multi-version API #4145
Conversation
4598b66
to
e8d1476
Compare
- Adjust webhook names for mutating and validating webhooks to avoid conflicts when creating multiple versions of the same API. More info: kubernetes-sigs#4144
e8d1476
to
2b49c7c
Compare
@@ -75,6 +75,8 @@ A webhook will automatically be served that calls this defaulting. | |||
The `Default` method is expected to mutate the receiver, setting the defaults. | |||
*/ | |||
|
|||
// +kubebuilder:webhook:path=/mutate-batch-tutorial-kubebuilder-io-v1-cronjob,mutating=true,failurePolicy=fail,sideEffects=None,groups=batch.tutorial.kubebuilder.io,resources=cronjobs,verbs=create;update,versions=v1,name=mcronjob-v1.kb.io,admissionReviewVersions=v1 | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A little newline bug here? Shouldn't the +kubebuilder directives be togeher?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One marker is for the Mutating Webhook, and the other is for the Validating Webhook. Each webhook is scaffolded with its respective code—one for mutation and the other for validation. So, it's not a bug. Either the scope of this PR is only sort out the bug. We cannot scaffold all with the same name , the names must be unique and because of this we are appending the version of the Kind on it.
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: camilamacedo86, mogsie The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
I am moving forward with this fix since we already have 1 LGTM, and it’s a small change. We also need to get this merged to properly auto-generate the multi-version tutorial. Additionally, I plan to ensure that all tutorials and samples are properly generated and well tested through CI before we begin working on the initiative to decouple the webhooks from the API. This way, we can ensure everything continues to work smoothly after those changes. |
Adjust webhook names for mutating and validating webhooks to avoid conflicts when creating multiple versions of the same API.
Closes: #4144