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: take KUBECONFIG env variable into consideration #340

Conversation

patrickpichler
Copy link
Contributor

@patrickpichler patrickpichler commented Apr 25, 2023

Closes #331

📑 Description

Before, the default value set for the --kubeconfig flag prevented the
KUBECONFIG env variable to be ever taken into consideration. This
behavior has now been fixed.

If --kubeconfig flag is set, it takes precedence over the KUBECONFIG env
variable.

✅ Checks

  • My pull request adheres to the code style of this project
  • My code requires changes to the documentation
  • I have updated the documentation as required
  • All the tests have passed

ℹ Additional Information

@patrickpichler patrickpichler requested review from a team as code owners April 25, 2023 21:06
@patrickpichler patrickpichler force-pushed the fix/332/kubeconfig-env-not-considered branch 2 times, most recently from d6cae31 to b49535c Compare April 25, 2023 21:07
Copy link
Contributor

@matthisholleville matthisholleville left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great contribution again ! Shouldn't we include a test to prevent this type of regression from happening in the future?

@patrickpichler
Copy link
Contributor Author

Mhmm to really test it, we would need some kind of end to end testing I guess. In general,
this would sound like a good thing to implement imho.

Tbh I would create a ticket for it though, as this needs some more thought put into it 🙂

@AlexsJones AlexsJones enabled auto-merge (squash) April 26, 2023 09:10
Before, the default value set for the `--kubeconfig` flag prevented the
`KUBECONFIG` env variable to be ever taken into consideration. This
behavior has now been fixed.

If `--kubeconfig` flag is set, it takes precedence over the `KUBECONFIG` env
variable.

fixes k8sgpt-ai#331

Signed-off-by: Patrick Pichler <git@patrickpichler.dev>
@patrickpichler patrickpichler force-pushed the fix/332/kubeconfig-env-not-considered branch from b49535c to 0b4e927 Compare April 26, 2023 12:12
@AlexsJones AlexsJones merged commit ee85d13 into k8sgpt-ai:main Apr 26, 2023
@patrickpichler patrickpichler deleted the fix/332/kubeconfig-env-not-considered branch April 26, 2023 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Respect the $KUBECONFIG env as top precedence
3 participants