This message was deleted.
# rancher-desktop
a
This message was deleted.
q
You could try:
kubectl config get-contexts
or, alternatively, click the Rancher icon in the menu bar and select a kubernetes context (e.g.
rancher-desktop
)
b
Thank you. It worked
f
The only way I've been able to reproduce this issue is when the
~/.kube/config
file already exists, and the
current-context
property is set to the empty string:
Copy code
current-context: ""
If the file doesn't exist, or if
current-context
is just
null
, it will automatically be set to
rancher-desktop
.
q
I can get it w/ the file present but no line
current-context:
(i commented mine out)
f
Really? I have to try that. I set
current-context: ~
, and the value was set afterwards
If I delete the line, it will be set too. Now going to test with commenting it out, but that would be really surprising if that is handled differently from deleting the line.
q
Copy code
Client Version: <http://version.Info|version.Info>{Major:"1", Minor:"23", GitVersion:"v1.23.3", GitCommit:"816c97ab8cff8a1c72eccca1026f7820e93e0d25", GitTreeState:"clean", BuildDate:"2022-01-25T21:25:17Z", GoVersion:"go1.17.6", Compiler:"gc", Platform:"darwin/amd64"}
f
Yeah, commented out line disappears and regular line is added in.
q
For me, i get the same complaint if i don't have the line at all
f
Did you wait long enough? The file is only updated once k3s is running
q
oh, i don't have k3s enabled 🙂
f
In that case there is no kube context we could set it to 🙂
q
And the reporter didn't mention k3s 🙂
f
Well,
kubectl
can only work (meaningfully) if you run
k3s
, otherwise you are limited to
info
and
context
subcommands, which are pretty useless on their own
Still curious how you can end up with the empty string in there, but it doesn't really matter; I'll just file an issue to treat it the same as being unset.
q
We use kubectl with various gke clusters...