trying a fix for logs
This commit is contained in:
parent
dd342fb40d
commit
8ff551ad06
@ -82,25 +82,27 @@ function getArcKubeconfig() {
|
||||
const runnerTempDirectory = process.env['RUNNER_TEMP']; // Using process.env until the core libs are updated
|
||||
const kubeconfigPath = path.join(runnerTempDirectory, `kubeconfig_${Date.now()}`);
|
||||
let azPath = yield io.which("az", true);
|
||||
let out = fs.openSync('./out.log', 'a');
|
||||
let err = fs.openSync('./err.log', 'a');
|
||||
const out = fs.openSync('./out.log', 'a');
|
||||
const err = fs.openSync('./out.log', 'a');
|
||||
if (method == 'service-account') {
|
||||
let saToken = core.getInput('token');
|
||||
if (!saToken) {
|
||||
throw Error("'saToken' is not passed for 'service-account' method.");
|
||||
}
|
||||
console.log('using service account method for authenticating to arc cluster.');
|
||||
child_process_1.spawn(azPath, ['connectedk8s', 'proxy', '-n', clusterName, '-g', resourceGroupName, '-f', kubeconfigPath, '--token', saToken], {
|
||||
const proc = child_process_1.spawn(azPath, ['connectedk8s', 'proxy', '-n', clusterName, '-g', resourceGroupName, '-f', kubeconfigPath, '--token', saToken], {
|
||||
detached: true,
|
||||
stdio: ['ignore', out, err]
|
||||
}).unref();
|
||||
});
|
||||
proc.unref();
|
||||
}
|
||||
else {
|
||||
console.log('using spn method for authenticating to arc cluster.');
|
||||
child_process_1.spawn(azPath, ['connectedk8s', 'proxy', '-n', clusterName, '-g', resourceGroupName, '-f', kubeconfigPath], {
|
||||
const proc = child_process_1.spawn(azPath, ['connectedk8s', 'proxy', '-n', clusterName, '-g', resourceGroupName, '-f', kubeconfigPath], {
|
||||
detached: true,
|
||||
stdio: ['ignore', out, err]
|
||||
}).unref();
|
||||
});
|
||||
proc.unref();
|
||||
}
|
||||
console.log('Waiting for 2 minutes for kubeconfig to be merged....');
|
||||
yield sleep(120000); //sleeping for 2 minutes to allow kubeconfig to be merged
|
||||
|
@ -78,24 +78,26 @@ export async function getArcKubeconfig(): Promise<string> {
|
||||
const runnerTempDirectory = process.env['RUNNER_TEMP']; // Using process.env until the core libs are updated
|
||||
const kubeconfigPath = path.join(runnerTempDirectory, `kubeconfig_${Date.now()}`);
|
||||
let azPath = await io.which("az", true);
|
||||
let out = fs.openSync('./out.log', 'a');
|
||||
let err = fs.openSync('./err.log', 'a');
|
||||
const out = fs.openSync('./out.log', 'a');
|
||||
const err = fs.openSync('./out.log', 'a');
|
||||
if (method == 'service-account'){
|
||||
let saToken = core.getInput('token');
|
||||
if(!saToken){
|
||||
throw Error("'saToken' is not passed for 'service-account' method.")
|
||||
}
|
||||
console.log('using service account method for authenticating to arc cluster.')
|
||||
spawn(azPath,['connectedk8s','proxy','-n',clusterName,'-g',resourceGroupName,'-f',kubeconfigPath,'--token',saToken], {
|
||||
const proc=spawn(azPath,['connectedk8s','proxy','-n',clusterName,'-g',resourceGroupName,'-f',kubeconfigPath,'--token',saToken], {
|
||||
detached: true,
|
||||
stdio: [ 'ignore', out, err ]
|
||||
}).unref();
|
||||
});
|
||||
proc.unref();
|
||||
} else{
|
||||
console.log('using spn method for authenticating to arc cluster.')
|
||||
spawn(azPath,['connectedk8s','proxy','-n',clusterName,'-g',resourceGroupName,'-f',kubeconfigPath], {
|
||||
const proc=spawn(azPath,['connectedk8s','proxy','-n',clusterName,'-g',resourceGroupName,'-f',kubeconfigPath], {
|
||||
detached: true,
|
||||
stdio: [ 'ignore', out, err ]
|
||||
}).unref();
|
||||
});
|
||||
proc.unref();
|
||||
}
|
||||
console.log('Waiting for 2 minutes for kubeconfig to be merged....')
|
||||
await sleep(120000) //sleeping for 2 minutes to allow kubeconfig to be merged
|
||||
|
Loading…
x
Reference in New Issue
Block a user