From 3aa19be83898b73622d438816f5290af04661935 Mon Sep 17 00:00:00 2001 From: shigupt202 <57620559+shigupt202@users.noreply.github.com> Date: Wed, 7 Oct 2020 15:00:26 +0530 Subject: [PATCH] Updating kubeconfig file permissions to remove helm warning (#16) --- lib/login.js | 1 + src/login.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/lib/login.js b/lib/login.js index 0a8ade25..2486ba81 100644 --- a/lib/login.js +++ b/lib/login.js @@ -112,6 +112,7 @@ function run() { const kubeconfigPath = path.join(runnerTempDirectory, `kubeconfig_${Date.now()}`); core.debug(`Writing kubeconfig contents to ${kubeconfigPath}`); fs.writeFileSync(kubeconfigPath, kubeconfig); + fs.chmodSync(kubeconfigPath, '600'); command_1.issueCommand('set-env', { name: 'KUBECONFIG' }, kubeconfigPath); console.log('KUBECONFIG environment variable is set'); yield setContext(kubeconfigPath); diff --git a/src/login.ts b/src/login.ts index 4a217355..d15e4243 100644 --- a/src/login.ts +++ b/src/login.ts @@ -108,6 +108,7 @@ async function run() { const kubeconfigPath = path.join(runnerTempDirectory, `kubeconfig_${Date.now()}`); core.debug(`Writing kubeconfig contents to ${kubeconfigPath}`); fs.writeFileSync(kubeconfigPath, kubeconfig); + fs.chmodSync(kubeconfigPath, '600'); issueCommand('set-env', { name: 'KUBECONFIG' }, kubeconfigPath); console.log('KUBECONFIG environment variable is set'); await setContext(kubeconfigPath);