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

Make sure kanctl honors KUBECONFIG env and kubeconfig dir #1247

Merged
merged 3 commits into from
Feb 22, 2022

Conversation

viveksinghggits
Copy link
Contributor

Change Overview

kanctl in current implentation create kubeclient using inClusterConfig
it doesn't check if the KUBECONFIG env var is set or config file is
available at default location.
This has resulted into problem for some of the users. This PR makes the
change to prioritise creating kubeclient in below order

  • KUBECONFIG env var
  • kubeconfig file at deafult location ~/.kube/config
  • Use inClusterConfig

Pull request type

Please check the type of change your PR introduces:

  • 🚧 Work in Progress
  • 🌈 Refactoring (no functional changes, no api changes)
  • 🐹 Trivial/Minor
  • 🐛 Bugfix
  • 🌻 Feature
  • 🗺️ Documentation
  • 🤖 Test

Issues

Test Plan

  • 💪 Manual
  • ⚡ Unit test
  • 💚 E2E

kanctl in current implentation create kubeclient using `inClusterConfig`
it doesn't check if the `KUBECONFIG` env var is set or config file is
available at default location.
This has resulted into problem for some of the users. This PR makes the
change to prioritise creating kubeclient in below order

- KUBECONFIG env var
- kubeconfig file at deafult location `~/.kube/config`
- Use `inClusterConfig`
pkg/kube/client.go Outdated Show resolved Hide resolved
@mergify mergify bot merged commit 22424ea into master Feb 22, 2022
@mergify mergify bot deleted the kanctl-kubeconfig branch February 22, 2022 09:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants