mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
remove references to double statics
Signed-off-by: Sebastian Malton <smalton@mirantis.com>
This commit is contained in:
parent
ac039006d6
commit
a917bb409c
@ -1,7 +1,7 @@
|
|||||||
import { spawn, ChildProcess } from "child_process"
|
import { spawn, ChildProcess } from "child_process"
|
||||||
import logger from "./logger"
|
import logger from "./logger"
|
||||||
import * as tcpPortUsed from "tcp-port-used"
|
import * as tcpPortUsed from "tcp-port-used"
|
||||||
import { Kubectl, bundledKubectl } from "./kubectl"
|
import { Kubectl } from "./kubectl"
|
||||||
import { Cluster } from "./cluster"
|
import { Cluster } from "./cluster"
|
||||||
import { readFileSync, watch } from "fs"
|
import { readFileSync, watch } from "fs"
|
||||||
import { PromiseIpc } from "electron-promise-ipc"
|
import { PromiseIpc } from "electron-promise-ipc"
|
||||||
@ -15,14 +15,12 @@ export class KubeAuthProxy {
|
|||||||
protected env: NodeJS.ProcessEnv = null
|
protected env: NodeJS.ProcessEnv = null
|
||||||
protected proxyProcess: ChildProcess
|
protected proxyProcess: ChildProcess
|
||||||
protected port: number
|
protected port: number
|
||||||
protected kubectl: Kubectl
|
|
||||||
protected promiseIpc: any
|
protected promiseIpc: any
|
||||||
|
|
||||||
constructor(cluster: Cluster, port: number, env: NodeJS.ProcessEnv) {
|
constructor(cluster: Cluster, port: number, env: NodeJS.ProcessEnv) {
|
||||||
this.env = env
|
this.env = env
|
||||||
this.port = port
|
this.port = port
|
||||||
this.cluster = cluster
|
this.cluster = cluster
|
||||||
this.kubectl = bundledKubectl
|
|
||||||
this.promiseIpc = new PromiseIpc({ timeout: 2000 })
|
this.promiseIpc = new PromiseIpc({ timeout: 2000 })
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -32,7 +30,7 @@ export class KubeAuthProxy {
|
|||||||
resolve()
|
resolve()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
const proxyBin = await this.kubectl.kubectlPath()
|
const proxyBin = await Kubectl.bundled().kubectlPath()
|
||||||
const configWatcher = watch(this.cluster.kubeconfigPath(), (eventType: string, filename: string) => {
|
const configWatcher = watch(this.cluster.kubeconfigPath(), (eventType: string, filename: string) => {
|
||||||
if (eventType === "change") {
|
if (eventType === "change") {
|
||||||
const kc = readFileSync(this.cluster.kubeconfigPath()).toString()
|
const kc = readFileSync(this.cluster.kubeconfigPath()).toString()
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import { LensApiRequest } from "../router"
|
import { LensApiRequest } from "../router"
|
||||||
import { LensApi } from "../lens-api"
|
import { LensApi } from "../lens-api"
|
||||||
import { spawn, ChildProcessWithoutNullStreams } from "child_process"
|
import { spawn, ChildProcessWithoutNullStreams } from "child_process"
|
||||||
import { bundledKubectl } from "../kubectl"
|
import { Kubectl } from "../kubectl"
|
||||||
import { getFreePort } from "../port"
|
import { getFreePort } from "../port"
|
||||||
import { shell } from "electron"
|
import { shell } from "electron"
|
||||||
import * as tcpPortUsed from "tcp-port-used"
|
import * as tcpPortUsed from "tcp-port-used"
|
||||||
@ -37,7 +37,7 @@ class PortForward {
|
|||||||
|
|
||||||
public async start() {
|
public async start() {
|
||||||
this.localPort = await getFreePort()
|
this.localPort = await getFreePort()
|
||||||
const kubectlBin = await bundledKubectl.kubectlPath()
|
const kubectlBin = await Kubectl.bundled().kubectlPath()
|
||||||
const args = [
|
const args = [
|
||||||
"--kubeconfig", this.kubeConfig,
|
"--kubeconfig", this.kubeConfig,
|
||||||
"port-forward",
|
"port-forward",
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user