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

Fix restconfig retrieval - don't get inclusterconfig when local #397

Merged

Conversation

johnmcollier
Copy link
Member

rest.InClusterConfig() only works when running in a Kubernetes pod, it won't work if you're running HAS locally. To work around that, if rest.InClusterConfig() fails, we should retrieve the Kubeconfig locally, first from the KUBECONFIG env var, then from ~/.kube/config if that fails.

Signed-off-by: John Collier <jcollier@redhat.com>
@openshift-ci
Copy link

openshift-ci bot commented Oct 5, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: johnmcollier, maysunfaisal

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:
  • OWNERS [johnmcollier,maysunfaisal]

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

@johnmcollier johnmcollier changed the title Fix restconfig retrieval - don't Fix restconfig retrieval - don't get inclusterconfig when local Oct 5, 2023
@johnmcollier
Copy link
Member Author

/retest

@johnmcollier johnmcollier merged commit 7441eb6 into redhat-appstudio:main Oct 5, 2023
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants