Skip to content
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

Fix HPA MetricSpec conversion #125

Merged
merged 2 commits into from
Aug 8, 2023

Conversation

voelzmo
Copy link
Member

@voelzmo voelzmo commented Aug 8, 2023

What this PR does / why we need it:
When the HVPA controller finds that the HPA Spec had changed, it tries to sync the existing HPA with the new information from the HVPA object. If we have k8s >= 1.23 with the autoscaling.k8s.io/v2 API available, a conversion for the MetricSpec is necessary, since this has incompatibly changed. We're re-using the existing conversion implementations from k/k inside the scheme, and those seem to take a MetricSpec pointer instead of an object.
Since the HPA spec is seldomly changed and we didn't have and envtest for it, we catched this only now.

Release note:

Fixed a bug that caused HVPA reconciliation to fail with `expected pointer, but got v2beta1.MetricSpec type` when the HPA spec had changed.

@voelzmo voelzmo requested a review from a team as a code owner August 8, 2023 09:36
@gardener-robot gardener-robot added needs/review Needs review size/xs Size of pull request is tiny (see gardener-robot robot/bots/size.py) labels Aug 8, 2023
@voelzmo
Copy link
Member Author

voelzmo commented Aug 8, 2023

/cc @andrerun

@gardener-robot-ci-2 gardener-robot-ci-2 added reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Aug 8, 2023
Copy link
Contributor

@andrerun andrerun left a comment

Choose a reason for hiding this comment

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

LGTM

controllers/hvpa_controller_test.go Show resolved Hide resolved
@voelzmo voelzmo merged commit 2cf9558 into gardener:master Aug 8, 2023
@gardener-robot gardener-robot added the status/closed Issue is closed (either delivered or triaged) label Aug 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) needs/review Needs review size/xs Size of pull request is tiny (see gardener-robot robot/bots/size.py) status/closed Issue is closed (either delivered or triaged)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants