-
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
Avoid to create an API client if not needed #10062
Conversation
did you sweep other factory methods to make sure we're not doing this elsewhere? |
looks like several other factory methods have the same issue |
@liggitt yeah there might be. Checking. |
46be4cf
to
54d9e3d
Compare
[test] |
@liggitt thanks for catching, there were a few others. Mind taking a look? |
@@ -714,6 +731,10 @@ func (f *Factory) PodForResource(resource string, timeout time.Duration) (string | |||
case api.Resource("pods"): | |||
return name, nil | |||
case api.Resource("replicationcontrollers"): |
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.
we could hit all these k8s resources and fail against a kubernetes server, right?
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.
Right. I must use f.Client()
instead of f.Clients()
so it only takes the kube client. Fixed.
54d9e3d
to
6ee31ee
Compare
LGTM |
[merge] |
continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/7117/) (Image: devenv-rhel7_4705) |
180b8b9
to
ae643e2
Compare
ae643e2
to
1a9766b
Compare
Evaluated for origin test up to 1a9766b |
continuous-integration/openshift-jenkins/test FAILURE (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/7100/) |
Evaluated for origin merge up to 1a9766b |
Fixes #9992
Only create an OpenShift API client if we are actually dealing with OpenShift objects. Will avoid trying to reach
/oapi
if we are only dealing with pods, which makesoc logs
to keep compatibility with a raw Kube server.@liggitt PTAL