feat: port forwarding backend part #7379
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?
One of the several PR, that is decided to merge separately.
The purpose of this pull request is to provide the server side code, that responsible for enabling port forwarding in a Kubernetes environment. The main part of code can be divided into two logical components: 1) managing user configurations (creation, updating, listing, deletion); 2) starting the forwarding process for a specific configuration.
The configuration management is based on binding to the currently used context. In other words, if a user calls a method to obtain a service
KubernetesPortForwardServiceProvider.getService
, Kubernetes configuration must be provided as an argument to this service provider. If the service has already been created previously, it will be returned from the local cache to prevent duplication of the service itself.All user configurations are stored by default in the application's configuration directory in the file
port-forwarding.json
. This file is essentially a dictionary where the keys are the context names, and the values are the user configurations.The general principle of using this service is as follows:
Screenshot / video of UI
No screenshots.
What issues does this PR fix or reference?
part of #7078
How to test this PR?
To be able to test the PR locally, this branch should be cloned locally and preliminary steps need to be performed:
packages/main/src/plugin
, e.g.kubernetes-port-forward.spec.ts
with the following content:http://localhost:8892
provides the content of page.http://localhost:8892
no more reachable.