Skip to content

Commit

Permalink
remove unregister cloud first
Browse files Browse the repository at this point in the history
  • Loading branch information
MoChilia committed Jun 18, 2024
1 parent ca0c27b commit 0df14e3
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
16 changes: 8 additions & 8 deletions lib/main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4037,14 +4037,14 @@ class AzureCliLogin {
if (!this.loginConfig.resourceManagerEndpointUrl) {
throw new Error("resourceManagerEndpointUrl is a required parameter when environment is defined.");
}
core.info(`Unregistering cloud: "${this.loginConfig.environment}" first if it exists`);
try {
yield this.executeAzCliCommand(["cloud", "set", "-n", "AzureCloud"], true);
yield this.executeAzCliCommand(["cloud", "unregister", "-n", this.loginConfig.environment], false);
}
catch (error) {
core.info(`Ignore cloud not registered error: "${error}"`);
}
// core.info(`Unregistering cloud: "${this.loginConfig.environment}" first if it exists`);
// try {
// await this.executeAzCliCommand(["cloud", "set", "-n", "AzureCloud"], true);
// await this.executeAzCliCommand(["cloud", "unregister", "-n", this.loginConfig.environment], false);
// }
// catch (error) {
// core.info(`Ignore cloud not registered error: "${error}"`);
// }
core.info(`Registering cloud: "${this.loginConfig.environment}" with ARM endpoint: "${this.loginConfig.resourceManagerEndpointUrl}"`);
try {
let baseUri = this.loginConfig.resourceManagerEndpointUrl;
Expand Down
16 changes: 8 additions & 8 deletions src/Cli/AzureCliLogin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,14 @@ export class AzureCliLogin {
throw new Error("resourceManagerEndpointUrl is a required parameter when environment is defined.");
}

core.info(`Unregistering cloud: "${this.loginConfig.environment}" first if it exists`);
try {
await this.executeAzCliCommand(["cloud", "set", "-n", "AzureCloud"], true);
await this.executeAzCliCommand(["cloud", "unregister", "-n", this.loginConfig.environment], false);
}
catch (error) {
core.info(`Ignore cloud not registered error: "${error}"`);
}
// core.info(`Unregistering cloud: "${this.loginConfig.environment}" first if it exists`);
// try {
// await this.executeAzCliCommand(["cloud", "set", "-n", "AzureCloud"], true);
// await this.executeAzCliCommand(["cloud", "unregister", "-n", this.loginConfig.environment], false);
// }
// catch (error) {
// core.info(`Ignore cloud not registered error: "${error}"`);
// }

core.info(`Registering cloud: "${this.loginConfig.environment}" with ARM endpoint: "${this.loginConfig.resourceManagerEndpointUrl}"`);
try {
Expand Down

0 comments on commit 0df14e3

Please sign in to comment.