-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
vpa-admission-controller: Wire contexts #6899
base: master
Are you sure you want to change the base?
Conversation
Skipping CI for Draft Pull Request. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: ialidzhikov The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
5856e41
to
10eeb15
Compare
@kwiesmueller could you have a look when you have time? Thanks in advance! |
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 a lot for this!
Some small nits.
Also is it possible to add a test that demonstrates the cancellation behavior added with this?
/hold
vertical-pod-autoscaler/pkg/target/controller_fetcher/controller_fetcher_test.go
Outdated
Show resolved
Hide resolved
10eeb15
to
c29cb95
Compare
For an integration test: I tested the change in a local setup where I simulated the client-side throttling issue described in #6891. I configured the admission-controller to run with min qps/burst values. I created VPAs that scale CR, so that the admission-controller has to fetch the /scale subresource. I verified that with this change when client-side throttling happens, the client side timeout is respected and request and all subsequent operations are canceled when the context is canceled (request times out). For unit tests: I am not sure if there is much value in unit tests in this scenario. For example, for the Pod resource handler, I can again pass a fake vpaMatcher. In the test verify that passing canceled context returns error. Somehow make sure that the Pod resource handler passes the @kwiesmueller do you have a suggestion what kind of test to add? |
216b0ac
to
598d103
Compare
Thanks for the PR, @ialidzhikov! For me, this is fine as-is. |
Thanks for the PR! |
Hm, I am not sure if such unit tests really make sense. It is more or less what @voelzmo wrote above #6899 (comment):
The |
What type of PR is this?
/kind bug
What this PR does / why we need it:
This PR wires contexts in the vpa-admission-controller so that it does no longer process admission requests after the requests is canceled client-side (kube-apiserver side) already.
Which issue(s) this PR fixes:
Fixes #6891
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: