Skip to content
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

Allow users to create bindings to roles #14547

Merged
merged 1 commit into from
Jun 14, 2017

Conversation

enj
Copy link
Contributor

@enj enj commented Jun 9, 2017

This change makes it so that you no longer need cluster admin privileges to create a role binding that references a role in your namespace. In the past we required a cluster admin to create the policy binding object before a normal user could perform these bindings. This change is required for us to deprecate policy and policy binding objects in 3.6.

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

Fixes #14078

cc @liggitt @deads2k PTAL

cc @benjaminapetersen @bparees @jfchevrette since you have encountered this before.

[test]

@enj
Copy link
Contributor Author

enj commented Jun 9, 2017

Flake #14555

@benjaminapetersen
Copy link
Contributor

Nice, this makes sense to me.

policyBinding, err := m.getPolicyBindingForPolicy(ctx, roleBinding.RoleRef.Namespace, allowEscalation)
// get or auto create policy binding so we can deprecate policy and policy binding objects in 3.6
// thus normal users can always create a role binding referring to a role
policyBinding, err := m.getPolicyBindingForPolicy(ctx, roleBinding.RoleRef.Namespace, true)
Copy link
Contributor

Choose a reason for hiding this comment

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

This would allows someone to create a rolebinding pointing to a role in another namespace. That is an anti-goal.

Copy link
Contributor Author

@enj enj Jun 9, 2017

Choose a reason for hiding this comment

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

oops, @deads2k instead of passing true I could pass roleBinding.RoleRef.Namespace == namespaceFromContext?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think so. Add a test to check.

This change makes it so that you no longer need cluster admin privileges
to create a role binding that references a role in your namespace.  In
the past we required a cluster admin to create the policy binding object
before a normal user could perform these bindings.  This change is
required for us to deprecate policy and policy binding objects in 3.6.

Signed-off-by: Monis Khan <[email protected]>
@enj enj force-pushed the enj/i/allow_local_binding/14078 branch from 4bf4db4 to 491b2f4 Compare June 12, 2017 15:59
@openshift-bot
Copy link
Contributor

Evaluated for origin test up to 491b2f4

@enj
Copy link
Contributor Author

enj commented Jun 12, 2017

@deads2k PTAL.

@openshift-bot
Copy link
Contributor

continuous-integration/openshift-jenkins/test FAILURE (https://ci.openshift.redhat.com/jenkins/job/test_pull_request_origin/2151/) (Base Commit: acb8636)

@enj
Copy link
Contributor Author

enj commented Jun 12, 2017

Flake #14129

@deads2k
Copy link
Contributor

deads2k commented Jun 12, 2017

lgtm [merge]

@openshift-bot
Copy link
Contributor

Evaluated for origin merge up to 491b2f4

@openshift-bot
Copy link
Contributor

openshift-bot commented Jun 14, 2017

continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/merge_pull_request_origin/993/) (Base Commit: 653b218) (Image: devenv-rhel7_6358)

@openshift-bot openshift-bot merged commit e87bd0c into openshift:master Jun 14, 2017
@liggitt
Copy link
Contributor

liggitt commented Jun 14, 2017

@enj can you sweep docs for references to the need to create this and make updates as needed. also, I think this is the last piece we need to announce deprecation of {cluster,}policy{binding,} in 3.6, right?

@liggitt
Copy link
Contributor

liggitt commented Jun 14, 2017

(means updating comments on API types and a release note in openshift/openshift-docs#4021)

@enj
Copy link
Contributor Author

enj commented Jun 14, 2017

I think this is the last piece we need to announce deprecation of {cluster,}policy{binding,} in 3.6, right?

@liggitt I believe so.

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.

5 participants