-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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 (kubernetes-client) : Throw exception when HasMetadata
is used in resources(...)
API (#3990)
#4133
Conversation
5e7ba81
to
d08901a
Compare
This was somewhat fixed by other upstream changes - you no longer get an npe, but an invalid url /api/v1/hasmetadatas We could be doing a similar check for CustomResource or in general not allow any interface or abstract class. Generic is different in that it's a concrete class. It's hard in general for us to determine that a particular concrete class is invalid as a resource - the underlying logic is tolerant to both the group and version annotations being missing in which case the Config.getApiVersion is used. |
I had pointed this out in #3990 (comment) Shall I add an additional check to throw IllegalArgumentException in case any interface is provided in |
Yes a check for interfaces or abstract would cover the HasMetadata case as well. |
The fix should address the comment #3990 (comment) which should mostly deal with UX. Users who perform such a call should get an explicit message stating that the operation is forbidden, and the suggested fix/alternative operation |
d08901a
to
aea78a1
Compare
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
…in `resources(...)` API (fabric8io#3990) Access to `resources(...)` DSL method with generic HasMetadata interface shouldn't be allowed. Signed-off-by: Rohan Kumar <rohaan@redhat.com>
SonarCloud Quality Gate failed. |
Description
Fix #3990
Access to
resources(...)
DSL method with generic HasMetadata interfaceshouldn't be allowed.
Signed-off-by: Rohan Kumar rohaan@redhat.com
Type of change
test, version modification, documentation, etc.)
Checklist