weaveworks / vscode-gitops-tools

GitOps Visual Studio Code Extension
Mozilla Public License 2.0
225 stars 22 forks source link

Kubectl proxy is run again for multiple extension instances #469

Open kingdonb opened 1 year ago

kingdonb commented 1 year ago

Expected behaviour

Since the kubeconfig context is global, I think there can only be one remote cluster connected at a time regardless of how many VSCode windows are open, they will all share the same kubeconfig and current context. So they should not spawn multiple instances of the kubectl proxy.

Actual behaviour

This seems to break down with enough vscode windows open if they are all running the gitops tools extension.

$ ps wuax|grep -i 'kubectl proxy'
kingdonb          6993   0.0  0.0 408626896   1344 s000  S+    9:54AM   0:00.00 grep -i kubectl proxy
kingdonb          6703   0.0  0.2 408754160  36432   ??  S     9:54AM   0:00.09 kubectl proxy -p 0
kingdonb          6704   0.0  0.2 408743664  37008   ??  S     9:54AM   0:00.11 kubectl proxy -p 0

If I have multiple vscode windows open and they are all connected to the gitops tools extension, then changing the context in one changes the context in all. This is about what I would expect to happen, but for some reason all of the tree view instances will get their own proxy configuration. This also seemingly sometimes causes the vscode editor to hang. I'm not sure if it's got anything to do with the multiple proxy processes spawned, or what, but the remediation I used was to force quit VSCode, and that left these proxy processes around (superseded by two new ones when I restarted the extension again in both windows.)

Steps to reproduce

Just try running two editor windows with the extension open in both

Versions

kubectl version: Flux version: Git version: Azure version: Extension version: v0.25.1693939383 VSCode version: Operating System (OS) and its version:

kingdonb commented 1 year ago

This is a known issue on v0.25.1 as well as all current edge/prerelease versions, recommended workaround right now is to avoid using the GitOps Tools extension in more than one VSCode editor window simultaneously.

kingdonb commented 9 months ago

We thought we had addressed this in 0.26.0 but we are still getting reports. Moving this to the current milestone.