diff --git a/src/main/resource-applier.ts b/src/main/resource-applier.ts index 7628166a26..0103416f43 100644 --- a/src/main/resource-applier.ts +++ b/src/main/resource-applier.ts @@ -20,12 +20,12 @@ export class ResourceApplier { } protected async kubectlApply(content: string): Promise { - const { kubeCtl, kubeConfigPath } = this.cluster; + const { kubeCtl } = this.cluster; const kubectlPath = await kubeCtl.getPath() return new Promise((resolve, reject) => { const fileName = tempy.file({ name: "resource.yaml" }) fs.writeFileSync(fileName, content) - const cmd = `"${kubectlPath}" apply --kubeconfig "${kubeConfigPath}" -o json -f "${fileName}"` + const cmd = `"${kubectlPath}" apply --kubeconfig "${this.cluster.getProxyKubeconfigPath()}" -o json -f "${fileName}"` logger.debug("shooting manifests with: " + cmd); const execEnv: NodeJS.ProcessEnv = Object.assign({}, process.env) const httpsProxy = this.cluster.preferences?.httpsProxy @@ -46,7 +46,7 @@ export class ResourceApplier { } public async kubectlApplyAll(resources: string[]): Promise { - const { kubeCtl, kubeConfigPath } = this.cluster; + const { kubeCtl } = this.cluster; const kubectlPath = await kubeCtl.getPath() return new Promise((resolve, reject) => { const tmpDir = tempy.directory() @@ -54,7 +54,7 @@ export class ResourceApplier { resources.forEach((resource, index) => { fs.writeFileSync(path.join(tmpDir, `${index}.yaml`), resource); }) - const cmd = `"${kubectlPath}" apply --kubeconfig "${kubeConfigPath}" -o json -f "${tmpDir}"` + const cmd = `"${kubectlPath}" apply --kubeconfig "${this.cluster.getProxyKubeconfigPath()}" -o json -f "${tmpDir}"` console.log("shooting manifests with:", cmd); exec(cmd, (error, stdout, stderr) => { if (error) { diff --git a/src/main/shell-session.ts b/src/main/shell-session.ts index 4b82b2d77d..b02b038aab 100644 --- a/src/main/shell-session.ts +++ b/src/main/shell-session.ts @@ -28,7 +28,7 @@ export class ShellSession extends EventEmitter { constructor(socket: WebSocket, cluster: Cluster) { super() this.websocket = socket - this.kubeconfigPath = cluster.kubeConfigPath + this.kubeconfigPath = cluster.getProxyKubeconfigPath() this.kubectl = new Kubectl(cluster.version) this.preferences = cluster.preferences || {} this.clusterId = cluster.id