Skip to content

Add Normalize Policy PostStartHook - #14410

Closed
enj wants to merge 1 commit into
openshift:masterfrom
enj:enj/i/normalize_policy_hook/13429
Closed

enj wants to merge 1 commit into
openshift:masterfrom
enj:enj/i/normalize_policy_hook/13429

Conversation

@enj

@enj enj commented May 30, 2017

Copy link
Copy Markdown
Contributor

NormalizePolicyPostStartHook lowercases APIGroups, Verbs, and Resources for all policy objects in the cluster. This should be dropped when we switch to Kubernetes RBAC.

Fixes #13429

[test]

Signed-off-by: Monis Khan [email protected]

NormalizePolicyPostStartHook lowercases APIGroups, Verbs, and Resources
for all policy objects in the cluster.  This should be dropped when we
switch to Kubernetes RBAC.

Signed-off-by: Monis Khan <[email protected]>
@enj
enj requested review from deads2k and liggitt May 30, 2017 18:29
@openshift-bot

Copy link
Copy Markdown
Contributor

Evaluated for origin test up to 5309011

@openshift-bot

Copy link
Copy Markdown
Contributor

for _, role := range clusterPolicy.Roles {
for i, rule := range role.Rules {
rule.Verbs = toLowerSet(rule.Verbs)
rule.Resources = toLowerSet(rule.Resources)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm this should probably be rule.Resources = authorizationapi.NormalizeResources(rule.Resources).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

utilruntime.HandleError(err)
return nil
}
for _, namespace := range namespaces.Items {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

post start hook is nice, but thinking about it, this is going to take a looong time. I see two possibilities:

  1. do it in the controller we have and check in the migration check.
  2. do in oadm migrate.

@enj Which would you do?

@enj

enj commented Jun 5, 2017

Copy link
Copy Markdown
Contributor Author

Superseded by #14475

@enj enj closed this Jun 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants