Skip to content

Commit

Permalink
Use up for just private registry scenario
Browse files Browse the repository at this point in the history
  • Loading branch information
snehapar9 committed Nov 7, 2023
1 parent 6865750 commit 2b40846
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions azurecontainerapps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ export class azurecontainerapps {
this.setupContainerAppImageProperties();

const useAzureContainerRegistry = !this.util.isNullOrEmpty(this.registryUrl) && this.registryUrl.endsWith('.azurecr.io');
const useInternalRegistry = this.util.isNullOrEmpty(this.registryUrl) && this.imageToBuild.startsWith(this.defaultRegistryServer);
this.useInternalRegistry = this.util.isNullOrEmpty(this.registryUrl) && this.imageToBuild.startsWith(this.defaultRegistryServer);

// Determine if the image should be built and pushed using the CLI
this.useCliToBuildAndPushImage = (useAzureContainerRegistry || useInternalRegistry);
this.useCliToBuildAndPushImage = (useAzureContainerRegistry || this.useInternalRegistry);

// If the application source was provided, build a runnable application image from it
if (!this.useCliToBuildAndPushImage && !this.util.isNullOrEmpty(this.appSourcePath)) {
Expand Down Expand Up @@ -544,7 +544,7 @@ export class azurecontainerapps {
if (!this.util.isNullOrEmpty(this.yamlConfigPath)) {
// Create the Container App from the YAML configuration file
await this.appHelper.createContainerAppFromYaml(this.containerAppName, this.resourceGroup, this.yamlConfigPath);
} else if ((!this.util.isNullOrEmpty(this.appSourcePath) && this.useCliToBuildAndPushImage)) {
} else if ((!this.util.isNullOrEmpty(this.appSourcePath) && this.useInternalRegistry)) {
await this.appHelper.createContainerAppWithUp(this.containerAppName, this.resourceGroup, this.containerAppEnvironment, this.commandLineArgs);
} else {
// Create the Container App from command line arguments
Expand Down
8 changes: 4 additions & 4 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ var azurecontainerapps = /** @class */ (function () {
}
azurecontainerapps.runMain = function () {
return __awaiter(this, void 0, void 0, function () {
var useAzureContainerRegistry, useInternalRegistry, err_1;
var useAzureContainerRegistry, err_1;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
Expand Down Expand Up @@ -91,9 +91,9 @@ var azurecontainerapps = /** @class */ (function () {
// Set up the Container App Image properties if it's not provided by the user.
this.setupContainerAppImageProperties();
useAzureContainerRegistry = !this.util.isNullOrEmpty(this.registryUrl) && this.registryUrl.endsWith('.azurecr.io');
useInternalRegistry = this.util.isNullOrEmpty(this.registryUrl) && this.imageToBuild.startsWith(this.defaultRegistryServer);
this.useInternalRegistry = this.util.isNullOrEmpty(this.registryUrl) && this.imageToBuild.startsWith(this.defaultRegistryServer);
// Determine if the image should be built and pushed using the CLI
this.useCliToBuildAndPushImage = (useAzureContainerRegistry || useInternalRegistry);
this.useCliToBuildAndPushImage = (useAzureContainerRegistry || this.useInternalRegistry);
if (!(!this.useCliToBuildAndPushImage && !this.util.isNullOrEmpty(this.appSourcePath))) return [3 /*break*/, 9];
return [4 /*yield*/, this.buildAndPushImageAsync()];
case 8:
Expand Down Expand Up @@ -638,7 +638,7 @@ var azurecontainerapps = /** @class */ (function () {
_a.sent();
return [3 /*break*/, 6];
case 2:
if (!(!this.util.isNullOrEmpty(this.appSourcePath) && this.useCliToBuildAndPushImage)) return [3 /*break*/, 4];
if (!(!this.util.isNullOrEmpty(this.appSourcePath) && this.useInternalRegistry)) return [3 /*break*/, 4];
return [4 /*yield*/, this.appHelper.createContainerAppWithUp(this.containerAppName, this.resourceGroup, this.containerAppEnvironment, this.commandLineArgs)];
case 3:
_a.sent();
Expand Down

0 comments on commit 2b40846

Please sign in to comment.