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

Support XDG_CACHE_HOME environment variable #93

Merged
merged 1 commit into from
Nov 26, 2018
Merged

Support XDG_CACHE_HOME environment variable #93

merged 1 commit into from
Nov 26, 2018

Conversation

rafi
Copy link
Contributor

@rafi rafi commented Oct 26, 2018

By using the XDG_CACHE_HOME environment variable, people who set kubectl's config file elsewhere (using the KUBECONFIG environment variable) could now bypass the error that ~/.kube directory doesn't exist, and also support the XDG standard :)

@googlebot
Copy link
Collaborator

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here (e.g. I signed it!) and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

@rafi
Copy link
Contributor Author

rafi commented Oct 26, 2018

I signed it!

@googlebot
Copy link
Collaborator

CLAs look good, thanks!

@ahmetb
Copy link
Owner

ahmetb commented Oct 26, 2018

@rafi thanks for your patch. Does kubectl actually respect XDG_CACHE_HOME today to locate your .kube/config file? If so, we can follow suit.

We should use exact same path determination logic to locate .kube/ directory. If kubectl uses another XDG_* env var, we should use that too. As far as I know, kubectl doesn't support XDG_* today.

@rafi
Copy link
Contributor Author

rafi commented Oct 26, 2018

@ahmetb No, it doesn't. But it supports the KUBECONFIG set a single or multiple configuration files, e.g. export KUBECONFIG="$XDG_CONFIG_HOME/kube/config.yml"

@ahmetb
Copy link
Owner

ahmetb commented Oct 26, 2018

I see we're using ~/.kube for caching stuff, so this will work. But you will still need to set KUBECONFIG to actually make things work.

I'll think a bit to see if this matches XDG_CACHE_HOME, XDG_CONFIG_HOME or XDG_DATA_HOME. But I think your patch is fine, I may merge it soon.

@ahmetb ahmetb merged commit 407a84c into ahmetb:master Nov 26, 2018
@ahmetb
Copy link
Owner

ahmetb commented Nov 26, 2018

Thanks a lot for your PR.

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