vscode-gitops-tools: Failed to get contexts
Expected behaviour
When I open the GitOps Tools extension I expect it to use the current context from my kubeconfig. It’s always worked that way in the past.
Actual behaviour
Instead, I get a message saying “Failed to get contexts: Config fetched, but contexts not found.”
Steps to reproduce
Open code
from a WSL command line. Select the GitOps Toolkit extension.
Versions
kubectl client v1.25.0 kubectl server v1.22.9+vmware.1 Flux: v0.32.0 Git: 2.25.1 Azure: 2.40.0 Azure extension “k8s-configuration”: not installed Azure extension “k8s-extension”: not installed VSCode: 1.72.0 Extension: 0.22.0 OS: Linux x64 5.15.57.1-microsoft-standard-WSL2
About this issue
- Original URL
- State: open
- Created 2 years ago
- Comments: 15
My (related) settings are the same as I left them back in November.
When I open VS Code in WSL, everything works. If I open VS Code from Windows, I get the following error.
If I use Set Kubeconfig to use “C:\Users\KenRider.kube\config” I get the following error even though kubectl is working from PowerShell and a command prompt.
First, it’s not just a WSL problem. If I open VS Code from PowerShell and the Windows desktop, I get the same behavior. I made a short video of starting VS Code from WSL then going to the GitOps extension. You can find it at https://clipchamp.com/watch/gDzBy58oP1l.
Second, my settings.json, regardless of where I open VS Code from, is the same and doesn’t have a
vs-kubernetes.knownKubeconfigs
. It only has avs-kubernetes.kubeconfig
.My WSL kubeconfig (/home/ken/.kube/config):
My Windows kubeconfig (C:\Users\KenRider.kube\config):
In regards to the localhost:8080 question, it must not be using my default kubeconfig or the kubeconfig referenced in settings.json as both have valid contexts.