Updating kubeconfig perms to remove helm warning

This commit is contained in:
Shivam Gupta 2020-10-05 10:32:37 +05:30
parent ebc225eb44
commit 481aa69a3c
2 changed files with 2 additions and 0 deletions

View File

@ -123,6 +123,7 @@ function run() {
const kubeconfigPath = path.join(runnerTempDirectory, `kubeconfig_${Date.now()}`); const kubeconfigPath = path.join(runnerTempDirectory, `kubeconfig_${Date.now()}`);
core.debug(`Writing kubeconfig contents to ${kubeconfigPath}`); core.debug(`Writing kubeconfig contents to ${kubeconfigPath}`);
fs.writeFileSync(kubeconfigPath, kubeconfig); fs.writeFileSync(kubeconfigPath, kubeconfig);
fs.chmodSync(kubeconfigPath, '600');
command_1.issueCommand('set-env', { name: 'KUBECONFIG' }, kubeconfigPath); command_1.issueCommand('set-env', { name: 'KUBECONFIG' }, kubeconfigPath);
console.log('KUBECONFIG environment variable is set'); console.log('KUBECONFIG environment variable is set');
yield setContext(kubeconfigPath); yield setContext(kubeconfigPath);

View File

@ -119,6 +119,7 @@ async function run() {
const kubeconfigPath = path.join(runnerTempDirectory, `kubeconfig_${Date.now()}`); const kubeconfigPath = path.join(runnerTempDirectory, `kubeconfig_${Date.now()}`);
core.debug(`Writing kubeconfig contents to ${kubeconfigPath}`); core.debug(`Writing kubeconfig contents to ${kubeconfigPath}`);
fs.writeFileSync(kubeconfigPath, kubeconfig); fs.writeFileSync(kubeconfigPath, kubeconfig);
fs.chmodSync(kubeconfigPath, '600');
issueCommand('set-env', { name: 'KUBECONFIG' }, kubeconfigPath); issueCommand('set-env', { name: 'KUBECONFIG' }, kubeconfigPath);
console.log('KUBECONFIG environment variable is set'); console.log('KUBECONFIG environment variable is set');
await setContext(kubeconfigPath); await setContext(kubeconfigPath);