Skip to content

Commit c4b7ead

Browse files
authored
Set values for quickstart image (#274)
* Implement quick start image * Hook up to ImageSourceListStep * Add back original statement
1 parent 4e0b461 commit c4b7ead

File tree

3 files changed

+19
-5
lines changed

3 files changed

+19
-5
lines changed

src/commands/createContainerApp/ImageSourceListStep.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { localize } from "../../utils/localize";
99
import { ContainerRegistryListStep } from "../deployImage/ContainerRegistryListStep";
1010
import { EnvironmentVariablesListStep } from "./EnvironmentVariablesListStep";
1111
import { IContainerAppContext } from './IContainerAppContext';
12+
import { setQuickStartImage } from "./setQuickStartImage";
1213

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

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

3839
switch (context.imageSource) {
3940
case ImageSource.QuickStartImage:
40-
// Todo: @mmott
41-
throw new Error('Not implemented yet');
41+
setQuickStartImage(context);
42+
break;
4243
case ImageSource.ExternalRegistry:
4344
promptSteps.push(new ContainerRegistryListStep(), new EnvironmentVariablesListStep());
4445
break;
4546
default:
46-
// Todo: Steps that lead to additional 'Build from project' options
47+
// Todo: Steps that lead to additional 'Build from project' options
4748
}
4849

4950
return { promptSteps };

src/commands/createContainerApp/IngressVisibilityStep.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ export class IngressVisibilityStep extends AzureWizardPromptStep<IContainerAppCo
1717
}
1818

1919
public shouldPrompt(context: IContainerAppContext): boolean {
20-
return context.enableIngress === true;
20+
return context.enableIngress === true && context.enableExternal === undefined;
2121
}
2222
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/*---------------------------------------------------------------------------------------------
2+
* Copyright (c) Microsoft Corporation. All rights reserved.
3+
* Licensed under the MIT License. See License.md in the project root for license information.
4+
*--------------------------------------------------------------------------------------------*/
5+
6+
import { IContainerAppContext } from "./IContainerAppContext";
7+
8+
export function setQuickStartImage(context: IContainerAppContext): void {
9+
context.image = 'mcr.microsoft.com/azuredocs/containerapps-helloworld:latest';
10+
context.enableIngress = true;
11+
context.enableExternal = true;
12+
context.targetPort = 80;
13+
}

0 commit comments

Comments
 (0)