Merge pull request #350 from octarinesec/repo-digests

Add repo digests if available from Stereoscope to the image metadata
This commit is contained in:
Robert Prince
2021-03-29 08:47:50 -07:00
committed by GitHub
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