mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
1 parent
d4ff99f3bf
commit
e9f60a7907
1 file changed
+8
-11
@@ -34,8 +34,6 @@ export class KubeAuthProxy {
|
|||||||
const args = [
|
const args = [
|
||||||
"proxy",
|
"proxy",
|
||||||
"-p", `${this.port}`,
|
"-p", `${this.port}`,
|
||||||
// "--kubeconfig", `"${this.cluster.kubeConfigPath}"`,
|
|
||||||
// "--context", `"${this.cluster.contextName}"`,
|
|
||||||
"--kubeconfig", `${this.cluster.kubeConfigPath}`,
|
"--kubeconfig", `${this.cluster.kubeConfigPath}`,
|
||||||
"--context", `${this.cluster.contextName}`,
|
"--context", `${this.cluster.contextName}`,
|
||||||
"--accept-hosts", ".*",
|
"--accept-hosts", ".*",
|
||||||
@@ -49,10 +47,7 @@ export class KubeAuthProxy {
|
|||||||
|
|
||||||
this.proxyProcess.on("exit", (code) => {
|
this.proxyProcess.on("exit", (code) => {
|
||||||
this.sendIpcLogMessage({ data: `proxy exited with code: ${code}`, error: code > 0 })
|
this.sendIpcLogMessage({ data: `proxy exited with code: ${code}`, error: code > 0 })
|
||||||
this.proxyProcess.removeAllListeners();
|
this.exit();
|
||||||
this.proxyProcess.stderr.removeAllListeners();
|
|
||||||
this.proxyProcess.stdout.removeAllListeners();
|
|
||||||
this.proxyProcess = null;
|
|
||||||
})
|
})
|
||||||
|
|
||||||
this.proxyProcess.stdout.on('data', (data) => {
|
this.proxyProcess.stdout.on('data', (data) => {
|
||||||
@@ -97,10 +92,12 @@ export class KubeAuthProxy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public exit() {
|
public exit() {
|
||||||
if (this.proxyProcess) {
|
if (!this.proxyProcess) return;
|
||||||
logger.debug("[KUBE-AUTH]: stopping local proxy", this.cluster.getMeta())
|
logger.debug("[KUBE-AUTH]: stopping local proxy", this.cluster.getMeta())
|
||||||
this.proxyProcess.kill()
|
this.proxyProcess.kill()
|
||||||
this.proxyProcess = null;
|
this.proxyProcess.removeAllListeners();
|
||||||
}
|
this.proxyProcess.stderr.removeAllListeners();
|
||||||
|
this.proxyProcess.stdout.removeAllListeners();
|
||||||
|
this.proxyProcess = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user