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

stop injecting special discovery behavior into oc/kubectl #19327

Merged
merged 4 commits into from
Apr 17, 2018

Conversation

deads2k
Copy link
Contributor

@deads2k deads2k commented Apr 11, 2018

This moves oc to use nothing but groupified APIs and allow us to eliminate any special factory handling. We'd have fewer special cases.

@openshift/sig-master

@openshift-ci-robot openshift-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. sig/master approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Apr 11, 2018
@openshift-ci-robot openshift-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Apr 11, 2018
@deads2k
Copy link
Contributor Author

deads2k commented Apr 11, 2018

Wow, that's a green test-cmd!

@deads2k
Copy link
Contributor Author

deads2k commented Apr 11, 2018

And the e2es are failing on the test for old defaulting. This is great. Looks like I just need to limit restmapper patch.

// The more groups you have, the more discovery requests you need to make.
// given 25 groups (our groups + a few custom resources) with one-ish version each, discovery needs to make 50 requests
// double it just so we don't end up here again for a while. This config is only used for discovery.
cfg.Burst = 100
Copy link
Member

Choose a reason for hiding this comment

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

This definitely deserves upstreaming.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This definitely deserves upstreaming.

Already working it

@@ -81,8 +81,8 @@ os::cmd::expect_success_and_text "curl -k -XPOST -H 'Content-Type: application/j
os::cmd::expect_success_and_text "curl -k -XPOST -H 'Content-Type: application/json' -H 'Authorization: Bearer ${accesstoken}' '${API_SCHEME}://${API_HOST}:${API_PORT}/apis/authorization.openshift.io/v1/subjectaccessreviews' -d '{\"namespace\":\"${project}\",\"verb\":\"create\",\"resource\":\"pods\"}'" '"kind": "SubjectAccessReviewResponse"'
os::cmd::expect_success_and_text "oc policy can-i create pods --token='${accesstoken}' -n '${project}' --ignore-scopes" 'yes'
os::cmd::expect_success_and_text "oc policy can-i create pods --token='${accesstoken}' -n '${project}'" 'no'
os::cmd::expect_success_and_text "oc policy can-i create subjectaccessreviews --token='${accesstoken}' -n '${project}'" 'no'
os::cmd::expect_success_and_text "oc policy can-i create subjectaccessreviews --token='${accesstoken}' -n '${project}' --ignore-scopes" 'yes'
os::cmd::expect_success_and_text "oc policy can-i create subjectaccessreviews.authorization.openshift.io --token='${accesstoken}' -n '${project}'" 'no'
Copy link
Contributor

Choose a reason for hiding this comment

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

is the full name required now? looks ugly

Copy link
Contributor Author

Choose a reason for hiding this comment

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

is the full name required now? looks ugly

It's a different resource if you let the group be filled in automatically.

@openshift-ci-robot openshift-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Apr 13, 2018
@deads2k deads2k changed the title [WIP] stop injecting special discovery behavior into oc/kubectl stop injecting special discovery behavior into oc/kubectl Apr 13, 2018
@openshift-ci-robot openshift-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 13, 2018
@deads2k
Copy link
Contributor Author

deads2k commented Apr 13, 2018

I've rebased this on top of all the prereq fixes. I think it may work.

@deads2k
Copy link
Contributor Author

deads2k commented Apr 13, 2018

This is a test update and commit fix up from green. I think we should do it.

@smarterclayton @liggitt anyone really against?

@openshift-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: deads2k

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@deads2k deads2k force-pushed the cli-23-removeoapi-2 branch 4 times, most recently from bcfcefd to 6b85582 Compare April 16, 2018 18:10
@openshift-bot openshift-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 16, 2018
@openshift-bot openshift-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 16, 2018
Copy link
Member

@soltysh soltysh left a comment

Choose a reason for hiding this comment

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

One small nit/question, otherwise this lgtm

@@ -27,7 +27,7 @@ cp "${KUBECONFIG}" "${login_kubeconfig}"
unset KUBECONFIG
unset KUBERNETES_MASTER
# test client not configured
os::cmd::expect_failure_and_text "env -u KUBERNETES_SERVICE_HOST oc get services" 'Missing or incomplete configuration info. Please login'
os::cmd::expect_failure_and_text "env -u KUBERNETES_SERVICE_HOST oc get services --loglevel=8" 'Missing or incomplete configuration info. Please login'
Copy link
Member

Choose a reason for hiding this comment

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

Debug leftover?

break
projectClient, err := projectclientinternal.NewForConfig(clientConfig)
// client create now *fails* if cannot connect to server; so, address connectivity errors below
if err == nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

what happens when err != nil ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

what happens when err != nil ?

Review with whitespace ignored. This increased nesting. The error is handled below as it was before.

if err != nil {
return err
}
o.AppsClient = appsClient
o.KClient = kClient
Copy link
Contributor

Choose a reason for hiding this comment

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

can you rename this to KubeClient since you are here?

@mfojtik
Copy link
Contributor

mfojtik commented Apr 17, 2018

LGTM as well, nice job!

@deads2k
Copy link
Contributor Author

deads2k commented Apr 17, 2018

nits addressed

@deads2k deads2k added the lgtm Indicates that a PR is ready to be merged. label Apr 17, 2018
@deads2k
Copy link
Contributor Author

deads2k commented Apr 17, 2018

/retest

@openshift-merge-robot openshift-merge-robot merged commit d5cb67d into openshift:master Apr 17, 2018
@deads2k deads2k deleted the cli-23-removeoapi-2 branch July 3, 2018 17:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. queue/multiple-rebases sig/master size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants