Open axel7083 opened 3 hours ago
I was working on https://github.com/containers/podman-desktop/issues/9273 and https://github.com/containers/podman-desktop/issues/9275 and I found a problem with the way we delete port foward added in https://github.com/containers/podman-desktop/pull/7379
When we delete a port forward we get the KubernetesPortForwardService
KubernetesPortForwardService
https://github.com/containers/podman-desktop/blob/2600ef0449b96d916cf282437d1320fbb5e1bbf1/packages/main/src/plugin/kubernetes/kubernetes-client.ts#L1772-L1774
The service itself ask the configuration to delete it
https://github.com/containers/podman-desktop/blob/2600ef0449b96d916cf282437d1320fbb5e1bbf1/packages/main/src/plugin/kubernetes/kubernetes-port-forward-service.ts#L105-L108
And the configuration remove it from its configuration: but do not dispose the server!!
https://github.com/containers/podman-desktop/blob/2600ef0449b96d916cf282437d1320fbb5e1bbf1/packages/main/src/plugin/kubernetes/kubernetes-port-forward-storage.ts#L324-L332
When we start the port forward, we do not store the disposable, meaning, we are never able to remove it.
https://github.com/containers/podman-desktop/blob/2600ef0449b96d916cf282437d1320fbb5e1bbf1/packages/main/src/plugin/kubernetes/kubernetes-client.ts#L1768
The only places where the disposables are stored are in the KubernetesPortForwardService, but they are an unusable Array
https://github.com/containers/podman-desktop/blob/ec3ee08dbe4ff0343f5cb12f70756d286c4f1e8a/packages/main/src/plugin/kubernetes/kubernetes-port-forward-service.ts#L68
Fedora 40
Other
next (development version)
No response
We would need to have somewhere, probably the KubernetesPortForwardService a Map linking a resources to the disposable, or something similar
cc @jeffmaury
Bug description
I was working on https://github.com/containers/podman-desktop/issues/9273 and https://github.com/containers/podman-desktop/issues/9275 and I found a problem with the way we delete port foward added in https://github.com/containers/podman-desktop/pull/7379
When we delete a port forward we get the
KubernetesPortForwardService
https://github.com/containers/podman-desktop/blob/2600ef0449b96d916cf282437d1320fbb5e1bbf1/packages/main/src/plugin/kubernetes/kubernetes-client.ts#L1772-L1774
The service itself ask the configuration to delete it
https://github.com/containers/podman-desktop/blob/2600ef0449b96d916cf282437d1320fbb5e1bbf1/packages/main/src/plugin/kubernetes/kubernetes-port-forward-service.ts#L105-L108
And the configuration remove it from its configuration: but do not dispose the server!!
https://github.com/containers/podman-desktop/blob/2600ef0449b96d916cf282437d1320fbb5e1bbf1/packages/main/src/plugin/kubernetes/kubernetes-port-forward-storage.ts#L324-L332
Why ?
When we start the port forward, we do not store the disposable, meaning, we are never able to remove it.
https://github.com/containers/podman-desktop/blob/2600ef0449b96d916cf282437d1320fbb5e1bbf1/packages/main/src/plugin/kubernetes/kubernetes-client.ts#L1768
The only places where the disposables are stored are in the
KubernetesPortForwardService
, but they are an unusable Arrayhttps://github.com/containers/podman-desktop/blob/ec3ee08dbe4ff0343f5cb12f70756d286c4f1e8a/packages/main/src/plugin/kubernetes/kubernetes-port-forward-service.ts#L68
Operating system
Fedora 40
Installation Method
Other
Version
next (development version)
Steps to reproduce
Relevant log output
No response
Additional context
We would need to have somewhere, probably the
KubernetesPortForwardService
a Map linking a resources to the disposable, or something similar