Skip to content

Commit b4689c0

Browse files
authored
Always default to a quick start image when running createContainerApp (#755)
1 parent c170a85 commit b4689c0

File tree

1 file changed

+17
-25
lines changed

1 file changed

+17
-25
lines changed

src/commands/createContainerApp/createContainerApp.ts

Lines changed: 17 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55

66
import { type ResourceGroup } from "@azure/arm-resources";
77
import { LocationListStep, ResourceGroupListStep } from "@microsoft/vscode-azext-azureutils";
8-
import { AzureWizard, createSubscriptionContext, nonNullProp, nonNullValue, nonNullValueAndProp, type AzureWizardExecuteStep, type AzureWizardPromptStep, type IActionContext } from "@microsoft/vscode-azext-utils";
8+
import { AzureWizard, createSubscriptionContext, nonNullProp, nonNullValue, nonNullValueAndProp, type IActionContext } from "@microsoft/vscode-azext-utils";
9+
import { ImageSource } from "../../constants";
910
import { ext } from "../../extensionVariables";
1011
import { ContainerAppItem } from "../../tree/ContainerAppItem";
1112
import { ManagedEnvironmentItem } from "../../tree/ManagedEnvironmentItem";
@@ -35,24 +36,11 @@ export async function createContainerApp(context: IActionContext, node?: Managed
3536
...await createActivityContext(),
3637
subscription: node.subscription,
3738
managedEnvironment: node.managedEnvironment,
38-
alwaysPromptIngress: true
39+
imageSource: ImageSource.QuickstartImage,
3940
};
4041

41-
const title: string = localize('createContainerApp', 'Create container app');
42-
43-
const promptSteps: AzureWizardPromptStep<ContainerAppCreateContext>[] = [
44-
new ContainerAppNameStep(),
45-
new ImageSourceListStep(),
46-
new IngressPromptStep(),
47-
];
48-
49-
const executeSteps: AzureWizardExecuteStep<ContainerAppCreateContext>[] = [
50-
getVerifyProvidersStep<ContainerAppCreateContext>(),
51-
new ContainerAppCreateStep(),
52-
];
53-
5442
if (isAzdExtensionInstalled()) {
55-
context.telemetry.properties.isAzdWorkspaceProject = 'true';
43+
wizardContext.telemetry.properties.isAzdWorkspaceProject = 'true';
5644
}
5745

5846
// Use the same resource group and location as the parent resource (managed environment)
@@ -63,25 +51,29 @@ export async function createContainerApp(context: IActionContext, node?: Managed
6351
await LocationListStep.setLocation(wizardContext, nonNullProp(node.resource, 'location'));
6452

6553
const wizard: AzureWizard<ContainerAppCreateContext> = new AzureWizard(wizardContext, {
66-
title,
67-
promptSteps,
68-
executeSteps,
54+
title: localize('createContainerApp', 'Create container app'),
55+
promptSteps: [
56+
new ContainerAppNameStep(),
57+
new ImageSourceListStep(),
58+
new IngressPromptStep(),
59+
],
60+
executeSteps: [
61+
getVerifyProvidersStep<ContainerAppCreateContext>(),
62+
new ContainerAppCreateStep(),
63+
],
6964
showLoadingPrompt: true
7065
});
71-
72-
// we want to add the quick start image _only_ for the create scenairo
73-
wizardContext.showQuickStartImage = true;
74-
7566
await wizard.prompt();
76-
const newContainerAppName = nonNullProp(wizardContext, 'newContainerAppName');
7767

68+
const newContainerAppName = nonNullProp(wizardContext, 'newContainerAppName');
7869
await ext.state.showCreatingChild(
7970
node.managedEnvironment.id,
8071
localize('creating', 'Creating "{0}"...', newContainerAppName),
8172
async () => {
8273
wizardContext.activityTitle = localize('createNamedContainerApp', 'Create container app "{0}"', newContainerAppName);
8374
await wizard.execute();
84-
});
75+
}
76+
);
8577

8678
const createdContainerApp = nonNullProp(wizardContext, 'containerApp');
8779
if (!wizardContext.suppressNotification) {

0 commit comments

Comments
 (0)