Fix: Recreate proxy kubeconfig if it is deleted (#2372)

This commit is contained in:
Lauri Nevala authored and GitHub committed 2021-03-23 08:12:01 -04:00
1 parent e70ac87c52
commit 4afec72ceb
11 files changed
+72 -43

No files matched your search

+1 -1
View File
@@ -44,7 +44,7 @@ class KubeconfigRoute extends LensApi {
public async routeServiceAccountRoute(request: LensApiRequest) {
const { params, response, cluster} = request;
const client = cluster.getProxyKubeconfig().makeApiClient(CoreV1Api);
const client = (await cluster.getProxyKubeconfig()).makeApiClient(CoreV1Api);
const secretList = await client.listNamespacedSecret(params.namespace);
const secret = secretList.body.items.find(secret => {
const { annotations } = secret.metadata;
+1 -1
View File
@@ -92,7 +92,7 @@ class PortForwardRoute extends LensApi {
namespace,
name: resourceName,
port,
kubeConfig: cluster.getProxyKubeconfigPath()
kubeConfig: await cluster.getProxyKubeconfigPath()
});
const started = await portForward.start();