-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathDisableIngressStep.ts
More file actions
28 lines (22 loc) · 1.46 KB
/
DisableIngressStep.ts
File metadata and controls
28 lines (22 loc) · 1.46 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
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { nonNullProp } from "@microsoft/vscode-azext-utils";
import type { Progress } from "vscode";
import { localize } from "../../../utils/localize";
import type { IngressContext } from "../IngressContext";
import { IngressUpdateStepBase } from "../IngressUpdateStepBase";
import { isIngressEnabled } from "../isIngressEnabled";
export class DisableIngressStep extends IngressUpdateStepBase<IngressContext> {
public priority: number = 750;
public async execute(context: IngressContext, progress: Progress<{ message?: string | undefined; increment?: number | undefined }>): Promise<void> {
const containerApp = nonNullProp(context, 'containerApp');
const working: string = localize('disablingIngress', 'Disabling ingress...');
const workCompleted: string = localize('disableCompleted', 'Disabled ingress for container app "{0}"', containerApp.name)
await this.updateIngressSettings(context, progress, { ingress: null, working, workCompleted });
}
public shouldExecute(context: IngressContext): boolean {
return context.enableIngress === false && isIngressEnabled(context);
}
}