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

Use XDG_CONFIG_HOME for location of the kn config #429

Closed
dprotaso opened this issue Oct 3, 2019 · 8 comments · Fixed by #668
Closed

Use XDG_CONFIG_HOME for location of the kn config #429

dprotaso opened this issue Oct 3, 2019 · 8 comments · Fixed by #668
Labels
good first issue Denotes an issue ready for a new contributor. kind/feature New feature or request
Milestone

Comments

@dprotaso
Copy link
Member

dprotaso commented Oct 3, 2019

In what area(s)?

/kind feature

Describe the feature:

Rather than contribute to the config pollution of the $HOME dir on Unix based systems can we following the XDG Base Directory Specification?

@dprotaso dprotaso added the kind/feature New feature or request label Oct 3, 2019
@maximilien
Copy link
Contributor

Interesting request. No experience using $XDG_CONFIG_HOME so excuse my nube question.

Can you list some precedence in the k8s community making a similar choice?

Thanks.

@dprotaso
Copy link
Member Author

dprotaso commented Oct 4, 2019

Can you list some precedence in the k8s community making a similar choice?

I see kustomize use it here

It's not a K8s specific thing - there are a few popular CLI apps that check for configs in $XDG_CONFIG_HOME and default to $HOME/.config are

See a list here: https://wiki.archlinux.org/index.php/XDG_Base_Directory#Supported

@maximilien
Copy link
Contributor

maximilien commented Oct 4, 2019

Let me tag @rhuss and @navidshaikh who are likely more expert than I am on this topic and see if they have any opinion(s).

This is my first time encountering or hearing about $XDG_CONFIG_HOME.

@rhuss
Copy link
Contributor

rhuss commented Oct 5, 2019

Maybe some background for the XDG Base Directory Specification:

XDG stands for "X Desktop Group" as is the predecessor of freedesktop.org, a project that was founded in 2000 (but "XDG" survived as an acronym in their specs). freedesktop.org might join the X.Org Foundation soon. The base directory specification was originally introduced in 2003 and has been picked up by many popular linux distributions as a recommended standard, like:

  • Debian: "Debian does not require that packages conform to the XDGBDS but strongly encourages upstreams to do so. Debian packages should not be patched for conformance to avoid unnecessary deviation from upstream and other distributions"
  • Archwiki promotes the usages of XDGBDS. This site has also a comprehensive list of tools and where they store their configuration files.

Also according to Wikipedia there seems to be a common agreement to move to ~/.config for configuration files:

Many applications, from bash to desktop environments such as GNOME now store their per-user configuration this way, but the Unix/Linux freedesktop.org XDG Base Directory Specification aims to migrate user config files from individual dotfiles in $HOME to non-hidden files in the hidden directory $HOME/.config


I'm positive to introduce XDGHOME to be a 'good' citizen in the Unix (Linux/macOS) world. However, for Windows we should adopt to the Windows standard. That is, AFAIK %APPDATA% or %LOCALAPPDATA% but I'm really no Windows expert. See this SO question for a suggested mapping of XDG base directories to Windows.

My suggestion would be now:

  • Use $XDG_CONFIG_HOME as based for the kn config directory, and if not set, use ~/.config
  • For Windows use, %LOCALAPPDATA%/kn as configuration directory

@maximilien
Copy link
Contributor

Thanks for the comment @rhuss. From your comment and references I would be incline not to change anything sine ~/.kn/... is more in line with current k8s config location.

However, I tend not to have strong opinions on defaults since they should be by definition what the majority wants and that changes over time. I'll let others chime in.

@jchesterpivotal
Copy link

I'm in favour of respecting XDG_CONFIG_HOME. It plays nicer with other software. I don't see kubectl as a decisive influence against adopting it.

@maximilien
Copy link
Contributor

Sorry but I don't see much more interest in this issue. I think staying in line with kubectl is a better route than adding this IMO and more importantly ~/.kn location is simple and easy to remember as is ~/.kube

Perhaps this can be suggested in next version or in kubectl WG as with this one. That way we can move in sync.

Unless I hear otherwise in next two days I will close this issue.

@rhuss
Copy link
Contributor

rhuss commented Jan 23, 2020

Well, Helm moved to XDG Base Directory Specification, too, so I think its actually the right way to go. But I agree that it is not of high priority (although I believe implementing it is trivial).

@rhuss rhuss added the good first issue Denotes an issue ready for a new contributor. label Jan 23, 2020
@navidshaikh navidshaikh added this to the v0.13.0 milestone Feb 28, 2020
coryrc pushed a commit to coryrc/client that referenced this issue May 14, 2020
us-central1 is too busy and lately have been experiencing stockouts too frequently.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Denotes an issue ready for a new contributor. kind/feature New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants