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

Remove use of policy API from CLI #15196

Merged
merged 1 commit into from
Jul 15, 2017

Conversation

enj
Copy link
Contributor

@enj enj commented Jul 13, 2017

This change removes the use of the policy API in CLI commands that interact with roles and bindings. The policy API is deprecated and will be removed in the 3.7 release. Thus this is required to make sure that a 3.6 oc binary continues to work with a 3.7 master.

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

@enj
Copy link
Contributor Author

enj commented Jul 13, 2017

@deads2k @liggitt @simo5 @abstractj PTAL (best viewed while ignoring whitespace). I did not see any other direct uses of policy when interacting with roles or bindings, but I could have missed something.

@openshift/security

[test]

@enj
Copy link
Contributor Author

enj commented Jul 13, 2017

[severity:blocker]

@openshift openshift deleted a comment from openshift-bot Jul 14, 2017
@openshift openshift deleted a comment from openshift-bot Jul 14, 2017
@openshift openshift deleted a comment from openshift-bot Jul 14, 2017
@smarterclayton
Copy link
Contributor

How comprehensive are the tests for this?

t := currBinding
for _, currBinding := range existingBindings.Items {
if currBinding.RoleRef.Name == role && currBinding.RoleRef.Namespace == "" {
t := authorizationapi.ToRoleBinding(&currBinding)
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this a deep copy?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No but this client side so it should not matter (the previous code was just a shallow copy also).

Copy link
Contributor

Choose a reason for hiding this comment

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

previous one didn't take the address of the iterator, this one does, which is a bug

@enj
Copy link
Contributor Author

enj commented Jul 14, 2017

How comprehensive are the tests for this?

@smarterclayton All invocations of oadm policy [add|remove]-role-[to|from]-.* rely on this along with a handful of integration tests. So that is roughly 70+ tests.

if err != nil {
return err
}
sort.Sort(authorizationapi.PolicyBindingSorter(bindingList.Items))
sort.Sort(sort.Reverse(authorizationapi.RoleBindingSorter(roleBindings.Items)))
Copy link
Contributor

Choose a reason for hiding this comment

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

why reverse?

@liggitt
Copy link
Contributor

liggitt commented Jul 14, 2017

one iterator address bug, one question on reverse, LGTM otherwise

This change removes the use of the policy API in CLI commands that
interact with roles and bindings.  The policy API is deprecated and
will be removed in the 3.7 release.  Thus this is required to make
sure that a 3.6 oc binary continues to work with a 3.7 master.

Signed-off-by: Monis Khan <[email protected]>
@enj enj force-pushed the enj/i/remove_policy_cli branch from 2a42af8 to 775b51d Compare July 14, 2017 18:56
@enj
Copy link
Contributor Author

enj commented Jul 14, 2017

re[test] GCE flake:

Jul 14 16:06:42.027: INFO: At 2017-07-14 16:06:27 -0400 EDT - event for pod-configmaps-e7b8f20c-68cf-11e7-a341-0ef067009f00: {kubelet ci-prtest-5a37c28-4334-ig-n-9143} Failed: Error: failed to start container "env-test": Error response from daemon: {"message":"cannot join network of a non running container: 746404bca8e8f64fe2d04be5cc09fa5009c9b4438edec236d17347523694347f"}

@openshift openshift deleted a comment from openshift-bot Jul 14, 2017
@openshift openshift deleted a comment from openshift-bot Jul 14, 2017
@openshift openshift deleted a comment from openshift-bot Jul 14, 2017
@openshift-bot
Copy link
Contributor

Evaluated for origin test up to 775b51d

@stevekuznetsov
Copy link
Contributor

@enj issue for that flake?

@openshift-bot
Copy link
Contributor

continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pull_request_origin/3172/) (Base Commit: bca9c79) (PR Branch Commit: 775b51d)

@liggitt liggitt added this to the 3.6.0 milestone Jul 15, 2017
@enj
Copy link
Contributor Author

enj commented Jul 15, 2017

[merge] comments addressed and change is fully backwards compatible.

@stevekuznetsov it did not make sense to me to tag an unrelated test failure based on a random infrastructure hiccup.

@openshift-bot
Copy link
Contributor

openshift-bot commented Jul 15, 2017

continuous-integration/openshift-jenkins/merge Waiting: You are in the build queue at position: 1

@openshift-bot
Copy link
Contributor

Evaluated for origin merge up to 775b51d

@stevekuznetsov
Copy link
Contributor

stevekuznetsov commented Jul 15, 2017

@enj

Failed: Error: failed to start container "env-test": Error response from daemon: {"message":"cannot join network of a non running container

How is this an infrastructure flake? We routinely send bug reports to the Docker daemon engineers, if that is where the bug is. Or that could be a kubelet error?

@openshift-bot openshift-bot merged commit 0720d4b into openshift:master Jul 15, 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.

5 participants