mirror of
https://github.com/ditkrg/k8s-set-context.git
synced 2026-01-22 22:06:49 +00:00
This commit is contained in:
parent
a0c4d79712
commit
c70c4ca5c2
@ -112,6 +112,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);
|
||||||
|
|||||||
@ -108,6 +108,7 @@ export 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);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user