-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Reduce use of memory in authorizer codepaths #18129
Conversation
request info should not need normalization... I think we can directly compare |
@@ -42,10 +42,10 @@ func (a *personalSARRequestInfoResolver) NewRequestInfo(req *http.Request) (*req | |||
case len(requestInfo.Subresource) != 0: | |||
return requestInfo, nil | |||
|
|||
case strings.ToLower(requestInfo.Verb) != "create": | |||
case strings.EqualFold(requestInfo.Verb, "create") != true: |
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.
!= true
?
@deads2k I vaguely remember reviewing this code. I believe we no longer need the normalization because RBAC is fully case sensitive? |
RequestInfo always have lowercase strings in it, so no need to lower case or casefold compare anything. Signed-off-by: Simo Sorce <[email protected]>
This will allow later to change upstream to use a pointer receiver for this interface so that copies will stop happening. Signed-off-by: Simo Sorce <[email protected]>
/retest |
A related PR is here kubernetes/kubernetes#58356 |
Flake #17556 |
/retest |
1 similar comment
/retest |
@deads2k PTAL PR is ready to go |
/assign @deads2k |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: deads2k, simo5 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
/test all [submit-queue is verifying that this PR is safe to merge] |
@simo5: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
Automatic merge from submit-queue (batch tested with PRs 18129, 18152, 17403, 18020, 18165). |
Fixes: #13316