-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Filter on resources that support get & delete #486
Conversation
pkg/discovery/helper.go
Outdated
@@ -109,7 +109,7 @@ func (h *helper) Refresh() error { | |||
|
|||
h.resources = discovery.FilteredBy( | |||
discovery.ResourcePredicateFunc(func(groupVersion string, r *metav1.APIResource) bool { |
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.
@nrb if you wanted to, you could extract this into a separate function, and then unit test it by providing different APIResource
s and ensuring that it returns true if and only if the resource supports all 4 verbs.
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.
That would make me a bit more confident in the change. I'll look into this.
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.
LGTM.
expected bool | ||
}{ | ||
{ | ||
name: "resource that supports list, create, get, delete", |
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 do 1 more that has this same set of 4 but in a different order? Also please have at least 1 test where there are additional Verbs such as update, patch, and deletecollection.
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.
Done
Some resources use GET for listing, which resulted in errors. Signed-off-by: Nolan Brubaker <[email protected]>
LGTM |
Some resources use GET for listing, which resulted in errors.
Fixes #475
Signed-off-by: Nolan Brubaker [email protected]