-
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
How to use subject access review in kubernetes-client? #1455
Comments
Does it work when you use resource DSL for creation? Something like this:
|
No, it does not work. I get this error:
I tried converting the review object to json and using load:
I get the same error. It looks for a handler for this object type and fails. Following is the stack trace:
|
oh, Try to do it like this: Line 72 in 1724b94
|
That works only for openshift client. I am using the kubernetes client, and it is not adaptable. |
@raiRaiyan : Could you please create a PR to add this in kubenetes client dsl? |
Ok. I will submit a PR once I get it working |
Closed via #1466 |
I want to use the kubernetes client to figure out if the client has the required permission to the resource. I can do this in kubectl using the following command:
kubectl auth can-i create deployments --namespace dev
This api uses
SelfSubjectAccessReview
according to the documentation. Does the kubernetes-client support this? If yes, how do I use it?Going through the source code, I was able to create the API object from
io.fabric8.kubernetes.api.model.authorization
like this:But i cannot use this either as there is no
Handler
for this type of a resource. Is there any way that I can use this API object for the time being?The text was updated successfully, but these errors were encountered: