✨ Make webhook setup conditional based on user provided config#3385
✨ Make webhook setup conditional based on user provided config#3385pmalek wants to merge 1 commit intokubernetes-sigs:mainfrom
Conversation
|
Skipping CI for Draft Pull Request. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: pmalek The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
/test pull-controller-runtime-test |
|
Am I understanding correctly that the use case is to have CRDs with multiple apiVersions without conversion? How does this work? |
|
@pmalek: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. DetailsInstructions 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. I understand the commands that are listed here. |
For my particular use case I don't need the conversion as I'm only testing the CRD CEL expressions and not controller's behavior. After looking at the test code in controller-runtime I came up with a stub conversion webhook server: which fulfilled my needs. I think we can close this one unless there's something that I missed which would make it reasonable to skip webhook altogether for use cases like mine. |
|
I'm mostly wondering why it just doesn't work out of the box. If the schema is configured correctly and conversion is implemented correctly envtest should just create a fully functioning conversion endpoint |
For historical reference (in case someone want to debug this):
|
Make webhook configuration apply only if it's specified by the user through:
.WebhookInstallOptions.ValidatingWebhooks.WebhookInstallOptions.MutatingWebhooks.Spec.Conversion.WebhooksetWithout this change, environments with CRDs that have multiple versions receive the following errors:
x-ref: https://kubernetes.slack.com/archives/C02MRBMN00Z/p1763049500384929