2017-10-10 20:12:19 +03:00
|
|
|
import { ImageNode } from "../explorer/models/imageNode";
|
2017-07-30 01:18:36 +03:00
|
|
|
import DockerInspectDocumentContentProvider from "../documentContentProviders/dockerInspect";
|
|
|
|
import { quickPickImage } from "./utils/quick-pick-image";
|
|
|
|
import { reporter } from "../telemetry/telemetry";
|
|
|
|
|
2017-10-10 20:12:19 +03:00
|
|
|
export default async function inspectImage(context?: ImageNode) {
|
2017-08-11 09:17:33 +03:00
|
|
|
|
|
|
|
let imageToInspect: Docker.ImageDesc;
|
|
|
|
|
|
|
|
if (context && context.imageDesc) {
|
|
|
|
imageToInspect = context.imageDesc;
|
|
|
|
} else {
|
|
|
|
const selectedImage = await quickPickImage();
|
|
|
|
if (selectedImage) {
|
|
|
|
imageToInspect = selectedImage.imageDesc;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (imageToInspect) {
|
|
|
|
await DockerInspectDocumentContentProvider.openImageInspectDocument(imageToInspect);
|
2017-11-25 07:11:19 +03:00
|
|
|
/* __GDPR__
|
|
|
|
"command" : {
|
|
|
|
"command" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
|
|
|
|
}
|
|
|
|
*/
|
2017-07-30 01:18:36 +03:00
|
|
|
reporter && reporter.sendTelemetryEvent("command", { command: "vscode-docker.image.inspect" });
|
|
|
|
}
|
|
|
|
};
|