From c70c4ca5c2d7f254dbc40e85af366c57c288bbc5 Mon Sep 17 00:00:00 2001 From: shigupt202 <57620559+shigupt202@users.noreply.github.com> Date: Wed, 7 Oct 2020 16:48:24 +0530 Subject: [PATCH] Updating kubeconfig file permissions to remove helm warning (#16) (#17) --- lib/login.js | 1 + src/login.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/lib/login.js b/lib/login.js index 07d53d84..09ba26bf 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 57c38a83..70feb513 100644 --- a/src/login.ts +++ b/src/login.ts @@ -108,6 +108,7 @@ export 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);