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 review endpoints on missing namespaces #11321

Merged
merged 2 commits into from
Oct 18, 2016

Conversation

deads2k
Copy link
Contributor

@deads2k deads2k commented Oct 11, 2016

fixes #11300

@@ -205,6 +205,7 @@ var accessReviewResources = map[unversioned.GroupResource]bool{
unversioned.GroupResource{Group: "", Resource: "resourceaccessreviews"}: true,
unversioned.GroupResource{Group: "", Resource: "localresourceaccessreviews"}: true,
unversioned.GroupResource{Group: "", Resource: "selfsubjectrulesreviews"}: true,
unversioned.GroupResource{Group: "", Resource: "subjectrulesreviews"}: true,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mfojtik we need to fix the need to add to two lists.

Copy link
Contributor

Choose a reason for hiding this comment

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

@deads2k can we generate this list from the upper list?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@deads2k can we generate this list from the upper list?

With enough restructuring, we might be able to use the upstream admission plugin. Right now, no.

@deads2k
Copy link
Contributor Author

deads2k commented Oct 11, 2016

[test]

Copy link
Contributor

@stevekuznetsov stevekuznetsov left a comment

Choose a reason for hiding this comment

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

Not a fan of naked os::cmd::expect_success.


os::test::junit::declare_suite_start "cmd/projects/lifecycle"
# resourceaccessreview
os::cmd::expect_success 'oc policy who-can get pods -n missing-ns'
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a weak test

# selfsubjectaccessreview
os::cmd::expect_success 'oc policy can-i get pods -n missing-ns'
# selfsubjectrulesreivew
os::cmd::expect_success 'oc policy can-i --list -n missing-ns'
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a weak test

@deads2k
Copy link
Contributor Author

deads2k commented Oct 11, 2016

Not a fan of naked os::cmd::expect_success.

Non-zero return checks exactly what need. Did this fail? No? Ok, success. The value returned doesn't matter.

@stevekuznetsov
Copy link
Contributor

Why not check that the rules review correctly finds nothing for the missing namespace? The CLI could exit with success and do the wrong thing ...

@deads2k
Copy link
Contributor Author

deads2k commented Oct 11, 2016

Why not check that the rules review correctly finds nothing for the missing namespace? The CLI could exit with success and do the wrong thing

Because it in most cases, the answer isn't nothing.

@deads2k
Copy link
Contributor Author

deads2k commented Oct 11, 2016

yum re[test]

@deads2k
Copy link
Contributor Author

deads2k commented Oct 12, 2016

authorizationapi.Resource("subjectaccessreviews"): true,
authorizationapi.Resource("localsubjectaccessreviews"): true,
authorizationapi.Resource("selfsubjectrulesreviews"): true,
authorizationapi.Resource("subjectrulesreviews"): true,
Copy link
Contributor

Choose a reason for hiding this comment

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

subjectrulesreviews isn't in the upstream set of accessReviewResources, need a carry commit to add it there

@deads2k
Copy link
Contributor Author

deads2k commented Oct 12, 2016

@mfojtik look good to you otherwise? if so, I'll update and merge.

@mfojtik
Copy link
Contributor

mfojtik commented Oct 12, 2016

@deads2k looks good

@deads2k
Copy link
Contributor Author

deads2k commented Oct 13, 2016

[merge]

@deads2k
Copy link
Contributor Author

deads2k commented Oct 17, 2016

yum re[test] re[merge]

@openshift-bot
Copy link
Contributor

Evaluated for origin merge up to e4c061f

@deads2k
Copy link
Contributor Author

deads2k commented Oct 17, 2016

re[test]

@openshift-bot
Copy link
Contributor

Evaluated for origin test up to e4c061f

@openshift-bot
Copy link
Contributor

continuous-integration/openshift-jenkins/test FAILURE (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/10126/) (Base Commit: 92a71d4)

@openshift-bot
Copy link
Contributor

openshift-bot commented Oct 18, 2016

continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/10204/) (Base Commit: a941850) (Image: devenv-rhel7_5196)

@openshift-bot openshift-bot merged commit e3a2814 into openshift:master Oct 18, 2016
@deads2k deads2k deleted the allow-who-can branch February 3, 2017 17:42
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.

who-can returns error in non-existent namespace
5 participants