-
Notifications
You must be signed in to change notification settings - Fork 39k
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
CRD Status subresource support get+update+patch #63619
Conversation
We need a test for that in test/integration in the apiextensions-apiserver. |
/assign @nikhita |
@@ -160,12 +160,17 @@ type StatusREST struct { | |||
store *genericregistry.Store | |||
} | |||
|
|||
var _ = rest.Updater(&StatusREST{}) | |||
var _ = rest.Patcher(&StatusREST{}) |
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.
nit: keep the Updater assertion and add Patcher
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.
Patcher assertion implies Updater assertion
kubernetes/staging/src/k8s.io/apiserver/pkg/registry/rest/rest.go
Lines 252 to 256 in c94efce
// Patcher is a storage object that supports both get and update. | |
type Patcher interface { | |
Getter | |
Updater | |
} |
but we don't have a lot of Updater/Patcher assertion in our code base (grep result is 1 Updater assertion and 6 Patcher assertion), so I don't know what is good convention/style
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.
This is fine as is, then
Integration test added to check we expose the verbs |
/retest |
} | ||
|
||
// make sure we don't get 405 Method Not Allowed from Patching CRD/status subresource | ||
_, err = apiExtensionClient.ApiextensionsV1beta1().CustomResourceDefinitions(). |
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.
nit: if err = ...; err != nil
Multi-line casing, so it makes sense as-is. :)
@@ -160,12 +160,17 @@ type StatusREST struct { | |||
store *genericregistry.Store | |||
} | |||
|
|||
var _ = rest.Updater(&StatusREST{}) | |||
var _ = rest.Patcher(&StatusREST{}) |
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.
Can you add this line to the custom resource StatusREST
as well? It currently satisfies the Patcher
interface implicitly and supports get/update/patch but I think explicitly mentioning it is nicer and safer.
Also, StatusREST
for deployments, statefulsets, etc does not implement Patcher
explicitly as well...but I guess we should add it at least for the custom resource.
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.
added
/area custom-resources |
cc @mbohlool |
/lgtm |
@roycaihw please squash. Then lgtm and approved. |
@sttts squashed |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: liggitt, roycaihw, sttts 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 |
/test all [submit-queue is verifying that this PR is safe to merge] |
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions here. |
Automatic merge from submit-queue (batch tested with PRs 62756, 63862, 61419, 64015, 64063). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. apiservices/status and certificatesigningrequests/status support get+update+patch **What this PR does / why we need it**: Fix the remaining `/status` subresources that return 405 on GET and PATCH **Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*: ref #63619 **Release note**: ```release-note apiservices/status and certificatesigningrequests/status now support GET and PATCH ```
Automatic merge from submit-queue (batch tested with PRs 62756, 63862, 61419, 64015, 64063). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. apiservices/status and certificatesigningrequests/status support get+update+patch **What this PR does / why we need it**: Fix the remaining `/status` subresources that return 405 on GET and PATCH **Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*: ref kubernetes/kubernetes#63619 **Release note**: ```release-note apiservices/status and certificatesigningrequests/status now support GET and PATCH ``` Kubernetes-commit: 74bcefc8b2bf88a2f5816336999b524cc48cf6c0
Automatic merge from submit-queue (batch tested with PRs 62756, 63862, 61419, 64015, 64063). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. apiservices/status and certificatesigningrequests/status support get+update+patch **What this PR does / why we need it**: Fix the remaining `/status` subresources that return 405 on GET and PATCH **Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*: ref kubernetes/kubernetes#63619 **Release note**: ```release-note apiservices/status and certificatesigningrequests/status now support GET and PATCH ``` Kubernetes-commit: 74bcefc8b2bf88a2f5816336999b524cc48cf6c0
Automatic merge from submit-queue (batch tested with PRs 62756, 63862, 61419, 64015, 64063). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. apiservices/status and certificatesigningrequests/status support get+update+patch **What this PR does / why we need it**: Fix the remaining `/status` subresources that return 405 on GET and PATCH **Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*: ref kubernetes/kubernetes#63619 **Release note**: ```release-note apiservices/status and certificatesigningrequests/status now support GET and PATCH ``` Kubernetes-commit: 74bcefc8b2bf88a2f5816336999b524cc48cf6c0
CRD Status previously only supports PUT and returns 405 on GET and PATCH
/assign @sttts
/sig api-machinery
Release note: