ignore remove extension error for ubuntu

This commit is contained in:
Atharva Mulmuley 2021-04-29 14:21:01 +05:30
parent e31e99aaab
commit 414366aae9
2 changed files with 12 additions and 2 deletions

View File

@ -71,7 +71,12 @@ function getArcKubeconfig() {
} }
yield az_login.main(); yield az_login.main();
yield az_login.executeAzCliCommand(`account show`, false); yield az_login.executeAzCliCommand(`account show`, false);
yield az_login.executeAzCliCommand(`extension remove -n connectedk8s`, false); try {
yield az_login.executeAzCliCommand(`extension remove -n connectedk8s`, false);
}
catch (_a) {
//ignore if this causes an error
}
yield az_login.executeAzCliCommand(`extension add -n connectedk8s`, false); yield az_login.executeAzCliCommand(`extension add -n connectedk8s`, false);
yield az_login.executeAzCliCommand(`extension list`, false); yield az_login.executeAzCliCommand(`extension list`, false);
const runnerTempDirectory = process.env['RUNNER_TEMP']; // Using process.env until the core libs are updated const runnerTempDirectory = process.env['RUNNER_TEMP']; // Using process.env until the core libs are updated

View File

@ -67,7 +67,12 @@ export async function getArcKubeconfig(): Promise<string> {
} }
await az_login.main(); await az_login.main();
await az_login.executeAzCliCommand(`account show`, false); await az_login.executeAzCliCommand(`account show`, false);
await az_login.executeAzCliCommand(`extension remove -n connectedk8s`, false); try{
await az_login.executeAzCliCommand(`extension remove -n connectedk8s`, false);
}
catch{
//ignore if this causes an error
}
await az_login.executeAzCliCommand(`extension add -n connectedk8s`, false); await az_login.executeAzCliCommand(`extension add -n connectedk8s`, false);
await az_login.executeAzCliCommand(`extension list`, false); await az_login.executeAzCliCommand(`extension list`, false);
const runnerTempDirectory = process.env['RUNNER_TEMP']; // Using process.env until the core libs are updated const runnerTempDirectory = process.env['RUNNER_TEMP']; // Using process.env until the core libs are updated