-
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
Use namespace from context #42652
Use namespace from context #42652
Conversation
cc @kubernetes/sig-auth-pr-reviews |
@@ -47,12 +47,17 @@ func (s *Storage) Create(ctx genericapirequest.Context, obj runtime.Object) (run | |||
return s.StandardStorage.Create(ctx, obj) | |||
} | |||
|
|||
namespace, ok := genericapirequest.NamespaceFrom(ctx) |
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 looks weird when you're reading it. Explain why we pull the namespace out here.
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.
so explained
lgtm, but I'd like an explanatory comment. Nearly everywhere else, the object is considered the source of truth, so this looks weird. |
#42639 flake |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED The following people have approved this PR: deads2k, liggitt Needs approval from an approver in each of these OWNERS Files:
We suggest the following people: |
Automatic merge from submit-queue |
Fixes #42653
Updates rbac_test.go to submit objects without namespaces set, which matches how actual objects are submitted to the API.