-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathIngressUpdateBaseStep.ts
More file actions
30 lines (25 loc) · 1.52 KB
/
IngressUpdateBaseStep.ts
File metadata and controls
30 lines (25 loc) · 1.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import type { Ingress } from "@azure/arm-appcontainers";
import { AzureWizardExecuteStep, nonNullProp } from "@microsoft/vscode-azext-utils";
import type { Progress } from "vscode";
import { ext } from "../../extensionVariables";
import type { IContainerAppContext } from "../IContainerAppContext";
import { updateContainerApp } from "../deployContainerApp/updateContainerApp";
type IngressOptions = {
ingress: Ingress | null,
working: string,
workCompleted: string
}
export abstract class IngressUpdateBaseStep<T extends IContainerAppContext> extends AzureWizardExecuteStep<T> {
protected async updateIngressSettings(context: T, progress: Progress<{ message?: string | undefined}>, options: IngressOptions): Promise<void> {
const containerApp = nonNullProp(context, 'containerApp');
const { ingress, working, workCompleted } = options;
progress.report({ message: working });
await updateContainerApp(context, context.subscription, containerApp, { configuration: { ingress: ingress as Ingress | undefined } });
ext.outputChannel.appendLog(workCompleted);
ext.state.notifyChildrenChanged(containerApp.managedEnvironmentId);
}
}