kubectl-cf icon indicating copy to clipboard operation
kubectl-cf copied to clipboard

[FEATURE] allow kubeconfig files to be symlinks

Open fredleger opened this issue 1 year ago • 1 comments

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 avatar May 16 '24 12:05 fredleger

I guess this can be tracked down to this line : https://github.com/surfinggo/kubectl-cf/blob/c6442055664674d0581ee54da288ebeac076e637/kube.go#L28

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

fredleger avatar May 16 '24 12:05 fredleger