-
Notifications
You must be signed in to change notification settings - Fork 1.6k
🐛 (go/v4,kustomize/v2): Fix problems by simplify scaffold and removing webhookcainjection_patch. Clarifying replacements for cert-manager #4123
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
Conversation
924c1fa to
0fcbbdd
Compare
8d61421 to
146865f
Compare
146865f to
34d079d
Compare
| # - select: | ||
| # kind: ValidatingWebhookConfiguration | ||
| # fieldPaths: | ||
| # - .metadata.annotations.[cert-manager.io/inject-ca-from] |
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.
@camilamacedo86 one question in this - replacements are executed sequentially. If we enable all defaulting, mutating and conversion - wouldn't the annotation be overwritten given the field path is the same?
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.
In our e2e tests, we have enabled all of them. You can see the changes here: Link to GitHub PR (we uncommented all tests, and they work as expected).
Additionally, the paths are different for each configuration. One will replace the ValidatingWebhookConfiguration, another will replace the MutatingWebhookConfiguration, and so on.
Moreover, in the e2e tests for the deploy image sample, we are specifically checking the scenario where only validating webhooks are scaffolded. You can review that here: Link to GitHub Workflow.
However, If you identify any scenarios where this could potentially cause issues, please let us know. We can then add e2e tests to ensure everything is functioning correctly.
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.
/hold
We are working to improve the coverage /tests so that we can ensure this one better
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.
/hold cancel
Now, see that we are testing with e2e all samples under testdata and the tutorial ones
Also, for go/v4 we added a test to validate webhooks when they are applied in a ns that is not the same where the operator and its server is running
So, it is very well covered too.
a7347f4 to
f4df3c6
Compare
f4df3c6 to
c26de0e
Compare
0ed05fd to
bd3991f
Compare
495d670 to
d0fd88b
Compare
b252b3b to
2ae2852
Compare
2ae2852 to
ccce3ae
Compare
|
c/c @lentzi90 |
|
Hi @erikgb You might be a good person to help us with the review of this one. |
ccce3ae to
07a6d52
Compare
varshaprasad96
left a comment
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.
/lgtm
/approve
Thanks @camilamacedo86 !
Kavinjsir
left a comment
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.
Looks good to me!
Nit:
Could we probably remove the code also at:
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: camilamacedo86, Kavinjsir, varshaprasad96 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 |
07a6d52 to
8a92032
Compare
|
New changes are detected. LGTM label has been removed. |
8a92032 to
226981f
Compare
|
New changes are detected. LGTM label has been removed. |
…tch and clarify replacements. - Removed config/default/webhookcainjection_patch.yaml to streamline the scaffold. - Clarified replacements blocks in kustomization.yaml for easier understanding. Each block is now labeled with instructions for uncommenting based on specific webhook scenarios (ValidatingWebhook, DefaultingWebhook, ConvertingWebhook).
226981f to
21e03d5
Compare
7527b0d
into
kubernetes-sigs:master
In PR kubernetes-sigs#4123, cert-manager CA injection annotations were added directly in the centralized config for ConversionWebhook: - Fields such as `fieldPath: .metadata.namespace` and `fieldPath: .metadata.name` were added to inject the CA into each CRD’s ConversionWebhook. However, this setup is redundant for ConversionWebhooks. Each CRD with a ConversionWebhook already receives the necessary CA injection through a patch managed by cert-manager, making a centralized configuration unnecessary. This commit removes the centralized CA injection configuration for ConversionWebhook to simplify the scaffold and prevent potential duplicate injection issues. Fixes: - Ensures CA injection is handled on a per-CRD basis by cert-manager patches, providing clear, efficient CA management for ConversionWebhooks.
Closes: #3538
Closes: #4119