From a917bb409c611d06b2b98f8bcb618b58cecf207d Mon Sep 17 00:00:00 2001 From: Sebastian Malton Date: Tue, 23 Jun 2020 16:24:31 -0400 Subject: [PATCH] remove references to double statics Signed-off-by: Sebastian Malton --- src/main/kube-auth-proxy.ts | 6 ++---- src/main/routes/port-forward.ts | 4 ++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/main/kube-auth-proxy.ts b/src/main/kube-auth-proxy.ts index c6f65f2419..8bf3e739b9 100644 --- a/src/main/kube-auth-proxy.ts +++ b/src/main/kube-auth-proxy.ts @@ -1,7 +1,7 @@ import { spawn, ChildProcess } from "child_process" import logger from "./logger" import * as tcpPortUsed from "tcp-port-used" -import { Kubectl, bundledKubectl } from "./kubectl" +import { Kubectl } from "./kubectl" import { Cluster } from "./cluster" import { readFileSync, watch } from "fs" import { PromiseIpc } from "electron-promise-ipc" @@ -15,14 +15,12 @@ export class KubeAuthProxy { protected env: NodeJS.ProcessEnv = null protected proxyProcess: ChildProcess protected port: number - protected kubectl: Kubectl protected promiseIpc: any constructor(cluster: Cluster, port: number, env: NodeJS.ProcessEnv) { this.env = env this.port = port this.cluster = cluster - this.kubectl = bundledKubectl this.promiseIpc = new PromiseIpc({ timeout: 2000 }) } @@ -32,7 +30,7 @@ export class KubeAuthProxy { resolve() }) } - const proxyBin = await this.kubectl.kubectlPath() + const proxyBin = await Kubectl.bundled().kubectlPath() const configWatcher = watch(this.cluster.kubeconfigPath(), (eventType: string, filename: string) => { if (eventType === "change") { const kc = readFileSync(this.cluster.kubeconfigPath()).toString() diff --git a/src/main/routes/port-forward.ts b/src/main/routes/port-forward.ts index 4b0a4077f0..3eae7d81f2 100644 --- a/src/main/routes/port-forward.ts +++ b/src/main/routes/port-forward.ts @@ -1,7 +1,7 @@ import { LensApiRequest } from "../router" import { LensApi } from "../lens-api" import { spawn, ChildProcessWithoutNullStreams } from "child_process" -import { bundledKubectl } from "../kubectl" +import { Kubectl } from "../kubectl" import { getFreePort } from "../port" import { shell } from "electron" import * as tcpPortUsed from "tcp-port-used" @@ -37,7 +37,7 @@ class PortForward { public async start() { this.localPort = await getFreePort() - const kubectlBin = await bundledKubectl.kubectlPath() + const kubectlBin = await Kubectl.bundled().kubectlPath() const args = [ "--kubeconfig", this.kubeConfig, "port-forward",