-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
stop injecting special discovery behavior into oc/kubectl #19327
Conversation
Wow, that's a green test-cmd! |
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This definitely deserves upstreaming.
There was a problem hiding this comment.
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' |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
5042f9e
to
80bdf3f
Compare
I've rebased this on top of all the prereq fixes. I think it may work. |
This is a test update and commit fix up from green. I think we should do it. @smarterclayton @liggitt anyone really against? |
80bdf3f
to
a5971e1
Compare
[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 |
bcfcefd
to
6b85582
Compare
6b85582
to
e659b32
Compare
e659b32
to
f7e8a85
Compare
f7e8a85
to
ebd6f88
Compare
There was a problem hiding this 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
test/cmd/login.sh
Outdated
@@ -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' |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
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.
pkg/oc/admin/prune/deployments.go
Outdated
if err != nil { | ||
return err | ||
} | ||
o.AppsClient = appsClient | ||
o.KClient = kClient |
There was a problem hiding this comment.
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?
LGTM as well, nice job! |
ebd6f88
to
e974738
Compare
nits addressed |
/retest |
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