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

[FEATURE] allow kubeconfig files to be symlinks #4

Open
fredleger opened this issue May 16, 2024 · 1 comment
Open

[FEATURE] allow kubeconfig files to be symlinks #4

fredleger opened this issue May 16, 2024 · 1 comment

Comments

@fredleger
Copy link

fredleger commented May 16, 2024

I think it can be very useful in some case to allow kubeconfigs files to be symlinks in $HOME/.kube/config

image

Here toto-2 is not detected as a kubeconfig file

OS: MacOS 14.4.1 (23E224) on silicon M1
Shell: zsh
kubectl-cf version: 0.2.0

@fredleger
Copy link
Author

I guess this can be tracked down to this line :

if file.IsDir() || IsSymlink(file) {

But removing the check don't assure you the link is pointing to a valid file (maybe it's a dir or something). So either using something like realpath onto *.kubeconfig "entries" or just defer the check to kubectl itslef.

From my testing the 2nd option seems viable :

image

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

No branches or pull requests

1 participant