-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable navigation to azure portal feature. (#128)
- Loading branch information
Showing
4 changed files
with
43 additions
and
3 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import * as vscode from 'vscode'; | ||
import * as k8s from 'vscode-kubernetes-tools-api'; | ||
import { IActionContext } from "vscode-azureextensionui"; | ||
import { getAksClusterTreeItem } from '../utils/clusters'; | ||
import { getExtensionPath } from '../utils/host'; | ||
import { failed } from '../utils/errorable'; | ||
|
||
export default async function aksNavToPortal( | ||
_context: IActionContext, | ||
target: any | ||
): Promise<void> { | ||
const cloudExplorer = await k8s.extension.cloudExplorer.v1; | ||
|
||
const cluster = getAksClusterTreeItem(target, cloudExplorer); | ||
if (failed(cluster)) { | ||
vscode.window.showErrorMessage(cluster.error); | ||
return; | ||
} | ||
|
||
const extensionPath = getExtensionPath(); | ||
if (failed(extensionPath)) { | ||
vscode.window.showErrorMessage(extensionPath.error); | ||
return; | ||
} | ||
|
||
// armid is in the format: /subscriptions/<sub_id>/resourceGroups/<resource_group>/providers/<container_service>/managedClusters/<aks_clustername> | ||
vscode.env.openExternal(vscode.Uri.parse(`https://portal.azure.com/#resource${cluster.result.armId}/overview`)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters