You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TLDR: Using Windows with Bash (e.g. git-bash from Git For Windows) + Windows version of kubeswitch results in
user@HOST MINGW64 /c/Users/user
$ s
switched to context dev-cluster
$ s
Error: the configured kubeconfig directory "C" does not exist
the configured kubeconfig directory "C" does not exist
$ s --debug
time="2024-10-17T12:40:16+03:00" level=debug msg="Adding kubeconfig path from KUBECONFIG env C:\\Users\\user/.kube/.switch_tmp\\config.2558873022.tmp"
time="2024-10-17T12:40:17+03:00" level=debug msg="Starting search for store: filesystem" store=filesystem
Error: the configured kubeconfig directory "C" does not exist
the configured kubeconfig directory "C" does not exist
$ echo$KUBECONFIG
KUBECONFIG=C:\Users\user/.kube/.switch_tmp\config.705829183.tmp
The switcher binary writes the filepath to the kubeconfig to STDOUT
The switch.sh script captures this filepath and executes export KUBECONFIG=</path/to/tmp/kubeconfig/file>
HOWEVER, convertion of KUBECONFIG to NEITHER Unix or Bash format works:
# trying UNIX path format
$ unset KUBECONFIG && s
switched to context dev-cluster
$ export KUBECONFIG=$(echo "$KUBECONFIG"| sed -e "s|^C:\\\\|/c/|" -e "s|\\\\|/|g")# same can be achieved by `cygpath -u $KUBECONFIG`, provided by https://www.msys2.org/docs/filesystem-paths/
$ echo$KUBECONFIG&& s --debug
/c/Users/user/.kube/.switch_tmp/config.2988942920.tmp
time="2024-10-17T13:40:19+03:00" level=debug msg="Adding kubeconfig path from KUBECONFIG env C:/Users/user/.kube/.switch_tmp/config.2988942920.tmp"
time="2024-10-17T13:40:20+03:00" level=debug msg="Starting search for store: filesystem" store=filesystem
Error: the configured kubeconfig directory "C" does not exist
the configured kubeconfig directory "C" does not exist
# and if we try WINDOWS path format:
$ export KUBECONFIG=$(cygpath -w $KUBECONFIG)&&echo$KUBECONFIG&& switch --debug
C:\Users\user\.kube\.switch_tmp\config.78735667.tmp
time="2024-10-17T14:01:09+03:00" level=debug msg="Adding kubeconfig path from KUBECONFIG env C:\\Users\\user\\.kube\\.switch_tmp\\config.78735667.tmp"
time="2024-10-17T14:01:10+03:00" level=debug msg="Starting search for store: filesystem" store=filesystem
Error: the configured kubeconfig directory "C" does not exist
the configured kubeconfig directory "C" does not exist
# Using binary directly does not help, same error:
$ switcher --debug
...
the configured kubeconfig directory "C" does not exist
Workaround:
unset KUBECONFIG before running switcher (we loose current context, bad)
Environment:
Version used 0.9.1
file shows: switcher.exe: PE32+ executable (console) x86-64, for MS Windows, 8 sections
TLDR: Using Windows with Bash (e.g. git-bash from Git For Windows) + Windows version of kubeswitch results in
! Notice mixed Windows and Linux style paths:
This stems from the fact, that binary and shell do work together: https://github.com/danielfoehrKn/kubeswitch/blob/master/docs/how_it_works.md
HOWEVER, convertion of KUBECONFIG to NEITHER Unix or Bash format works:
Workaround:
unset KUBECONFIG before running switcher (we loose current context, bad)
Environment:
file
shows: switcher.exe: PE32+ executable (console) x86-64, for MS Windows, 8 sectionsHow to repeat
P.S.:
Configuration uses
~
and it works fine, shows up in selectionThe text was updated successfully, but these errors were encountered: