-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathbrowseContainerApp.ts
More file actions
24 lines (20 loc) · 1.2 KB
/
browseContainerApp.ts
File metadata and controls
24 lines (20 loc) · 1.2 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
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { ContainerApp } from '@azure/arm-appcontainers';
import { IActionContext } from '@microsoft/vscode-azext-utils';
import { ContainerAppItem, isIngressEnabled } from '../tree/ContainerAppItem';
import { localize } from '../utils/localize';
import { openUrl } from '../utils/openUrl';
import { pickContainerApp } from '../utils/pickContainerApp';
export async function browseContainerAppNode(context: IActionContext, node?: ContainerAppItem): Promise<void> {
node ??= await pickContainerApp(context)
await browseContainerApp(node.containerApp);
}
export async function browseContainerApp(containerApp: ContainerApp): Promise<void> {
if (isIngressEnabled(containerApp)) {
return await openUrl(`https://${containerApp.configuration.ingress.fqdn}`);
}
throw new Error(localize('enableIngress', 'Enable ingress to perform this action.'));
}