-
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
Add NormalizePolicyRules to authorizationsync #14475
Add NormalizePolicyRules to authorizationsync #14475
Conversation
lgtm, but fix your cache mutation problem here: https://ci.openshift.redhat.com/jenkins/job/test_pull_request_origin/1933/ |
@@ -75,6 +75,9 @@ func (c *OriginClusterRoleToRBACClusterRoleController) syncClusterRole(name stri | |||
return c.rbacClient.ClusterRoles().Delete(name, nil) | |||
} | |||
|
|||
// normalize rules before conversion so RBAC's case sensitive authorizer will work | |||
NormalizePolicyRules(originClusterRole.Rules) |
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 is mutating a cache. Seems like you'd do this on the RBAC rule after you converted and copied.
NormalizePolicyRules lowercases APIGroups, Verbs and Resources. By using it before persistence, all RBAC roles will work with Kubernetes' case sensitive authorizer. Signed-off-by: Monis Khan <mkhan@redhat.com>
96125e0
to
84385aa
Compare
Evaluated for origin test up to 84385aa |
@deads2k cache mutation should be fixed now. |
continuous-integration/openshift-jenkins/test FAILURE (https://ci.openshift.redhat.com/jenkins/job/test_pull_request_origin/1985/) (Base Commit: 6a2194d) |
Flake #14496 |
Evaluated for origin merge up to 84385aa |
continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/merge_pull_request_origin/947/) (Base Commit: cf830c4) (Image: devenv-rhel7_6338) |
NormalizePolicyRules
lowercasesAPIGroups
,Verbs
andResources
. By using it before persistence, all RBAC roles will work with Kubernetes' case sensitive authorizer.Fixes #13429
Supersedes #14410
[test]
Signed-off-by: Monis Khan mkhan@redhat.com
cc @deads2k