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

Avoid to create an API client if not needed #10062

Merged
merged 1 commit into from
Jul 29, 2016

Conversation

fabianofranz
Copy link
Member

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 makes oc logs to keep compatibility with a raw Kube server.

@liggitt PTAL

@liggitt
Copy link
Contributor

liggitt commented Jul 27, 2016

did you sweep other factory methods to make sure we're not doing this elsewhere?

@liggitt
Copy link
Contributor

liggitt commented Jul 27, 2016

looks like several other factory methods have the same issue

@fabianofranz
Copy link
Member Author

@liggitt yeah there might be. Checking.

@fabianofranz
Copy link
Member Author

[test]

@fabianofranz
Copy link
Member Author

@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"):
Copy link
Contributor

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?

Copy link
Member Author

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.

@liggitt
Copy link
Contributor

liggitt commented Jul 27, 2016

LGTM

@fabianofranz
Copy link
Member Author

[merge]

@openshift-bot
Copy link
Contributor

openshift-bot commented Jul 28, 2016

continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/7117/) (Image: devenv-rhel7_4705)

@fabianofranz fabianofranz force-pushed the issues_9992 branch 2 times, most recently from 180b8b9 to ae643e2 Compare July 28, 2016 18:42
@openshift-bot
Copy link
Contributor

Evaluated for origin test up to 1a9766b

@openshift-bot
Copy link
Contributor

continuous-integration/openshift-jenkins/test FAILURE (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/7100/)

@openshift-bot
Copy link
Contributor

Evaluated for origin merge up to 1a9766b

@openshift-bot openshift-bot merged commit 7f9500a into openshift:master Jul 29, 2016
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.

3 participants