diff --git a/src/config.ts b/src/config.ts index 3af34dd3e7..afa7faa130 100644 --- a/src/config.ts +++ b/src/config.ts @@ -311,25 +311,25 @@ export class KubeConfig { } if (process.platform === 'win32' && shelljs.which('wsl.exe')) { try { - const envKubeconfigPathResult = execa.sync('wsl.exe', ['bash', '-ic', 'printenv KUBECONFIG']); + const envKubeconfigPathResult = execa.sync('wsl.exe', ['bash', '-c', 'printenv KUBECONFIG']); if (envKubeconfigPathResult.exitCode === 0 && envKubeconfigPathResult.stdout.length > 0) { const result = execa.sync('wsl.exe', ['cat', envKubeconfigPathResult.stdout]); if (result.exitCode === 0) { this.loadFromString(result.stdout, opts); return; } - if (result.exitCode === 0) { - this.loadFromString(result.stdout, opts); - return; - } } } catch (err) { // Falling back to default kubeconfig } try { - const result = execa.sync('wsl.exe', ['cat', '~/.kube/config']); - if (result.exitCode === 0) { - this.loadFromString(result.stdout, opts); + const configResult = execa.sync('wsl.exe', ['cat', '~/.kube/config']); + if (configResult.exitCode === 0) { + this.loadFromString(configResult.stdout, opts); + const result = execa.sync('wsl.exe', ['wslpath', '-w', '~/.kube']); + if (result.exitCode === 0) { + this.makePathsAbsolute(result.stdout); + } return; } } catch (err) { diff --git a/src/exec.ts b/src/exec.ts index 50a508537c..b51ec78706 100644 --- a/src/exec.ts +++ b/src/exec.ts @@ -27,7 +27,7 @@ export class Exec { * @param {boolean} tty - Should the command execute in a TTY enabled session. * @param {(V1Status) => void} statusCallback - * A callback to received the status (e.g. exit code) from the command, optional. - * @return {string} This is the result + * @return {Promise} A promise that will return the web socket created for this command. */ public async exec( namespace: string,