Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions src/commands/createContainerApp/ImageSourceListStep.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { localize } from "../../utils/localize";
import { ContainerRegistryListStep } from "../deployImage/ContainerRegistryListStep";
import { EnvironmentVariablesListStep } from "./EnvironmentVariablesListStep";
import { IContainerAppContext } from './IContainerAppContext';
import { setQuickStartImage } from "./setQuickStartImage";

export class ImageSourceListStep extends AzureWizardPromptStep<IContainerAppContext> {
public async prompt(context: IContainerAppContext): Promise<void> {
Expand All @@ -20,7 +21,7 @@ export class ImageSourceListStep extends AzureWizardPromptStep<IContainerAppCont

const placeHolder: string = localize('imageBuildSourcePrompt', 'Select an image source for the container app');
const picks: IAzureQuickPickItem<ImageSourceValues | undefined>[] = [
{ label: imageSourceLabels[0], data: ImageSource.QuickStartImage, suppressPersistence: true },
{ label: imageSourceLabels[0], data: ImageSource.QuickStartImage, suppressPersistence: true },
{ label: imageSourceLabels[1], data: ImageSource.ExternalRegistry, suppressPersistence: true },
// { label: imageSourceLabels[2], data: undefined, suppressPersistence: true },
];
Expand All @@ -37,13 +38,13 @@ export class ImageSourceListStep extends AzureWizardPromptStep<IContainerAppCont

switch (context.imageSource) {
case ImageSource.QuickStartImage:
// Todo: @mmott
throw new Error('Not implemented yet');
setQuickStartImage(context);
break;
case ImageSource.ExternalRegistry:
promptSteps.push(new ContainerRegistryListStep(), new EnvironmentVariablesListStep());
break;
default:
// Todo: Steps that lead to additional 'Build from project' options
// Todo: Steps that lead to additional 'Build from project' options
}

return { promptSteps };
Expand Down
2 changes: 1 addition & 1 deletion src/commands/createContainerApp/IngressVisibilityStep.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ export class IngressVisibilityStep extends AzureWizardPromptStep<IContainerAppCo
}

public shouldPrompt(context: IContainerAppContext): boolean {
return context.enableIngress === true;
return context.enableExternal === undefined;
Comment thread
MicroFish91 marked this conversation as resolved.
Outdated
}
}
13 changes: 13 additions & 0 deletions src/commands/createContainerApp/setQuickStartImage.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.md in the project root for license information.
*--------------------------------------------------------------------------------------------*/

import { IContainerAppContext } from "./IContainerAppContext";

export function setQuickStartImage(context: IContainerAppContext): void {
context.image = 'mcr.microsoft.com/azuredocs/containerapps-helloworld:latest';
context.enableIngress = true;
context.enableExternal = true;
context.targetPort = 80;
}