-
Notifications
You must be signed in to change notification settings - Fork 81
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
[DNM 2.10.3] Add schema links and resource methods for resource verb patch #450
base: main
Are you sure you want to change the base?
Conversation
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 needs to be brought into alignment with main after a recent fix to steve.
…and add patch ResourceMethod to the schema.
It looks like apiserver sets the links for self, update, and remove, but not for patch. I think it's probably something that I'll need to add there first, and then the patch link should be there so I can make this look like the other verbs here in Steve |
@@ -8,6 +8,7 @@ replace ( | |||
github.com/crewjam/saml => github.com/rancher/saml v0.2.0 | |||
github.com/knative/pkg => github.com/rancher/pkg v0.0.0-20181214184433-b04c0947ad2f | |||
github.com/matryer/moq => github.com/rancher/moq v0.0.0-20190404221404-ee5226d43009 | |||
github.com/rancher/apiserver => github.com/crobby/apiserver v0.5.2-0.20250116110826-e76f13e6c0bd |
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.
I typically leave PRs in draft mode when I'm referencing local repos until they get merged in.
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.
fair enough
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.
Everything but the references to crobby/apiserver looks good.
NOTE: overriding the apiserver version until rancher/apiserver#128 is merged/tagged
Issue: rancher/rancher#40712
Previously, we have not factored-in nor included the patch resource permission in our object links or schema for resource methods.
With this change, if a user has patch permission on an object, it will be reflected in both the links for an object as well as the resource methods on the schema.
Testing:
Manual testing done
Unit tests added
Helpful testing information:
To see the schema for something like apps.deployments, you can go to: /v1/schemas/apps.deployments
In the resultant json, if the user has patch permissions, you should see something like...
included in the yaml blob.
Likewise, if you look at the api view for an object, you will see the patch link defined when a user has patch permissions on that object.
{ "patch": "https://localhost:9443/apis/apps/v1/namespaces/default/deployments/nginx-deployment", "self": "https://localhost:9443/v1/apps.deployments/default/nginx-deployment", "update": "https://localhost:9443/apis/apps/v1/namespaces/default/deployments/nginx-deployment", "view": "https://localhost:9443/apis/apps/v1/namespaces/default/deployments/nginx-deployment" }