-
Notifications
You must be signed in to change notification settings - Fork 522
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a way to view image manifest (#4134)
- Loading branch information
1 parent
596916b
commit e882270
Showing
5 changed files
with
43 additions
and
6 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
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,24 @@ | ||
/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See LICENSE.md in the project root for license information. | ||
*--------------------------------------------------------------------------------------------*/ | ||
|
||
import { IActionContext, openReadOnlyJson } from "@microsoft/vscode-azext-utils"; | ||
import { CommonTag, RegistryV2DataProvider } from "@microsoft/vscode-docker-registries"; | ||
import { ext } from "../../extensionVariables"; | ||
import { UnifiedRegistryItem } from "../../tree/registries/UnifiedRegistryTreeDataProvider"; | ||
import { registryExperience } from "../../utils/registryExperience"; | ||
|
||
export async function inspectRemoteImageManifest(context: IActionContext, node?: UnifiedRegistryItem<CommonTag>): Promise<void> { | ||
if (!node) { | ||
node = await registryExperience<CommonTag>(context, { | ||
registryFilter: { exclude: [ext.dockerHubRegistryDataProvider.label] }, | ||
contextValueFilter: { include: /commontag/i, }, | ||
}); | ||
} | ||
|
||
const v2DataProvider = node.provider as unknown as RegistryV2DataProvider; | ||
const manifest = await v2DataProvider.getManifestV1(node.wrappedItem); | ||
|
||
await openReadOnlyJson({ label: node.wrappedItem.label, fullId: node.wrappedItem.id || node.wrappedItem.label }, manifest); | ||
} |