Skip to content

Kubectl proxy is run again for multiple extension instances #469

Open
@kingdonb

Description

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:

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions