-
Notifications
You must be signed in to change notification settings - Fork 42k
Add policy/v1 Eviction support #100724
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
Add policy/v1 Eviction support #100724
Conversation
7ebd9f5 to
a5085fa
Compare
|
/triage accepted |
a5085fa to
af2dced
Compare
|
/hold cancel |
|
/lgtm |
|
For conformance tests, ideally we wouldn't rely on the text of the error string. Given that we are looking for a specific reason in this test, I will allow it this time, though. /approve |
|
#101019 flake |
4925676 to
02c3a97
Compare
|
integration failure was related, making the scope AcceptsGroupVersionKind check compare Kind changed the error text returned from a bad kind. Limited the check here to apiVersion, so bad kinds continue to get the existing BadRequest error. |
|
delta to scope the new check to just groupVersion is in https://github.com/kubernetes/kubernetes/compare/4925676c62578e09379e504699dfe8aff51c5b1c..02c3a97815f553af4d4d01a6d343c3ec0a692b28 |
02c3a97 to
a07d446
Compare
That's a good point. I switched the test to look for the error cause (which is intended to be programmatically readable) rather than the error text, and defined a constant in the API package for that cause. See the |
Excellent, that's much better. /approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: johnbelamaric, lavalamp, liggitt, mortent The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/lgtm |
What type of PR is this?
/kind feature
/kind api-change
What this PR does / why we need it:
Adds support for accepting Eviction policy/v1
To maintain compatibility with existing clients that send policy/v1beta1 Eviction requests to pods/eviction, this requires allowing subresource REST storage to accept multiple versions.
This PR:
Also tested skew manually:
kubectl drainagainst this PR:I0401 23:22:54.885823 41250 request.go:1107] Request Body: {"kind":"Eviction","apiVersion":"policy/v1beta1","metadata":{"name":"testpod","namespace":"default","creationTimestamp":null},"deleteOptions":{}} I0401 23:22:54.885849 41250 round_trippers.go:425] curl -k -v -XPOST -H "Content-Type: application/json" -H "Accept: application/json, */*" -H "User-Agent: kubectl-1.20/v1.20.0 (darwin/amd64) kubernetes/af46c47" 'https://localhost:6443/api/v1/namespaces/default/pods/testpod/eviction' I0401 23:22:54.957882 41250 round_trippers.go:445] POST https://localhost:6443/api/v1/namespaces/default/pods/testpod/eviction 201 Created in 72 millisecondsI0401 23:28:44.729905 47080 request.go:1123] Request Body: {"kind":"Eviction","apiVersion":"policy/v1beta1","metadata":{"name":"testpod","namespace":"default","creationTimestamp":null},"deleteOptions":{}} I0401 23:28:44.729969 47080 round_trippers.go:435] curl -k -v -XPOST -H "User-Agent: kubectl-1.22-dev/v1.22.0 (darwin/amd64) kubernetes/64e09ac" -H "Content-Type: application/json" -H "Accept: application/json, */*" 'https://localhost:6443/api/v1/namespaces/default/pods/testpod/eviction' I0401 23:28:44.805242 47080 round_trippers.go:454] POST https://localhost:6443/api/v1/namespaces/default/pods/testpod/eviction 201 Created in 75 millisecondsDoes this PR introduce a user-facing change?
/milestone v1.22
cc @mortent