-
Notifications
You must be signed in to change notification settings - Fork 4.2k
fix(VPA): Do not update webhook CA when registerWebhook is disabled #8249
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
Welcome @vflaux! |
Hi @vflaux. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
/ok-to-test |
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.
Thanks for this
|
||
func (cr *certReloader) reloadWebhookCA() error { | ||
client := cr.mutatingWebhookClient | ||
if client == nil { |
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.
Correct me if I'm wrong, but in the current implementation, if the flag is off, then mutatingWebhookClient
is set to nil, which means the reloadWebhookCA
function will always return an error?
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.
Yes but we don't watch the file when mutatingWebhookClient
is nil so we should never call reloadWebhookCA()
.
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.
I use mutatingWebhookClient
as an indicator of whether registerWebhook
is enabled, but introducing a new boolean variable in the struct certReloader
might make the code clearer and easier to understand?
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.
Understood. thanks! adding a comment above line 71 (https://github.com/kubernetes/autoscaler/pull/8249/files#diff-504643e3760ffc997b03797073b201284f6483f8276acd1cf9057c8734e9f5b9R71) will be enough.
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.
Thanks for this!
/lgtm
/assign @adrianmoisey
Makes sense, thanks @omerap12 should we also backport this change? |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: adrianmoisey, vflaux 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 |
Yup! |
This was added in 1.4, so only need to do 1 cherry pick: |
@adrianmoisey: new pull request created: #8257 In response to this:
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. |
What type of PR is this?
/kind bug
What this PR does / why we need it:
This disable the update of CA in the MutatingWebhookConfiguration by the admission controller when the
registerWebhook
option is not enabled and the CA file changed.Which issue(s) this PR fixes:
Fixes #8248
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: