Add repo digests if available from Stereoscope to the image metadata

Signed-off-by: Haim Helman <hhelman@vmware.com>
This commit is contained in:
Haim Helman
2021-03-25 05:57:23 -07:00
parent cedf8cd6d7
commit 13a066ea18
2 changed files with 3 additions and 0 deletions
+2
View File
@@ -14,6 +14,7 @@ type ImageMetadata struct {
Layers []LayerMetadata `json:"layers"`
RawManifest []byte `json:"manifest"`
RawConfig []byte `json:"config"`
RepoDigests []string `json:"repoDigests"`
}
// LayerMetadata represents all static metadata that defines what a container image layer is.
@@ -40,6 +41,7 @@ func NewImageMetadata(img *image.Image, userInput string) ImageMetadata {
Layers: make([]LayerMetadata, len(img.Layers)),
RawConfig: img.Metadata.RawConfig,
RawManifest: img.Metadata.RawManifest,
RepoDigests: img.Metadata.RepoDigests,
}
// populate image metadata