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

"~/.kube/cache/oidc-login" on Windows is not the user home directory but a literal "~" directory in user home #543

Closed
LulaSvob opened this issue Apr 26, 2021 · 2 comments · Fixed by #550
Labels
bug Something isn't working

Comments

@LulaSvob
Copy link

Describe the issue

Cache on Windows is in a folder called "~" inside the user directory. I.e. C:\Users\<User.Name>\~\.kube

To reproduce

On Widows go to C:\Users\<User.Name>\~\.kube

Your environment

  • OS: Windows 10
  • kubelogin version: kubelogin version v1.23.1 (go1.16.3 windows_amd64)
  • kubectl version: v1.20.4
  • OpenID Connect provider: Key Cloak
@LulaSvob LulaSvob added the bug Something isn't working label Apr 26, 2021
@trexx
Copy link

trexx commented May 3, 2021

This seems to be a result of this change where previously a library detected the home directory, now the tilde is hardcoded and breaks on Windows. Whats worse is that it creates the ~ directory in the working directory. So you leave oidc tokens everywhere...beware committing secrets in to git.
https://github.com/int128/kubelogin/pull/489/files
#488

You can override the directory with a parameter in your kube config with token-cache-dir but this isn't helpful when you share configuration between WSL and Windows.
The default was cross platform friendly, and anyone who needed to override it could with token-cache-dir. The newly introduced expansion in that pull request would still work for anyone who overrode token-cache-dir with a literal ~ in their path.

@int128 @Mattias- What do you think about reverting the default to utilising homedir.Dir() for all platforms?

@int128
Copy link
Owner

int128 commented May 3, 2021

Thank you for bringing up this issue. I will fix this soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants