Skip to content

Conversation

vflaux
Copy link
Contributor

@vflaux vflaux commented Jun 18, 2025

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?

Vertical Pod Autoscaler Admission Controller will not try to update the `vpa-webhook-config` MutatingWebhookConfiguration when `registerWebhook` is disabled.

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


@k8s-ci-robot k8s-ci-robot added kind/bug Categorizes issue or PR as related to a bug. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. area/vertical-pod-autoscaler labels Jun 18, 2025
@k8s-ci-robot
Copy link
Contributor

Welcome @vflaux!

It looks like this is your first PR to kubernetes/autoscaler 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/autoscaler has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot
Copy link
Contributor

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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

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.

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jun 18, 2025
@k8s-ci-robot k8s-ci-robot requested review from omerap12 and voelzmo June 18, 2025 16:24
@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jun 18, 2025
@omerap12
Copy link
Member

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jun 19, 2025
Copy link
Member

@omerap12 omerap12 left a 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 {
Copy link
Member

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?

Copy link
Contributor Author

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().

Copy link
Contributor Author

@vflaux vflaux Jun 20, 2025

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?

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

@omerap12 omerap12 left a 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

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 20, 2025
@adrianmoisey
Copy link
Member

Makes sense, thanks
/approve

@omerap12 should we also backport this change?

@k8s-ci-robot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 20, 2025
@omerap12
Copy link
Member

Makes sense, thanks /approve

@omerap12 should we also backport this change?

Yup!

@k8s-ci-robot k8s-ci-robot merged commit ffd18e3 into kubernetes:master Jun 20, 2025
6 of 7 checks passed
@adrianmoisey
Copy link
Member

This was added in 1.4, so only need to do 1 cherry pick:
/cherry-pick vpa-release-1.4

@k8s-infra-cherrypick-robot

@adrianmoisey: new pull request created: #8257

In response to this:

This was added in 1.4, so only need to do 1 cherry pick:
/cherry-pick vpa-release-1.4

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/vertical-pod-autoscaler cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[VPA] Admission cert reloader use a hardcoded MutatingWebhookConfiguration name
5 participants