mirror of
https://github.com/anchore/syft.git
synced 2026-10-31 06:26:30 +01:00
include image labels in cycloneDX SBOM (#2294)
* include image labels in SBOM Signed-off-by: Benji Visser <benji@093b.org> * update tests Signed-off-by: Benji Visser <benji@093b.org> * gocritic Signed-off-by: Benji Visser <benji@093b.org> * add properties Signed-off-by: Benji Visser <benji@093b.org> * add decoder Signed-off-by: Benji Visser <benji@093b.org> * update golden snapshots Signed-off-by: Benji Visser <benji@093b.org> * decodeProperties Signed-off-by: Benji Visser <benji@093b.org> * add test Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com> * remove the snapshot test changes Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com> * restore snapshots Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com> --------- Signed-off-by: Benji Visser <benji@093b.org> Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com> Co-authored-by: Alex Goodman <wagoodman@users.noreply.github.com>
This commit is contained in:
co-authored by
Alex Goodman
parent
502971a1b2
commit
0891d35e07
@@ -18,6 +18,7 @@ type StereoscopeImageSourceMetadata struct {
|
||||
Architecture string `json:"architecture"`
|
||||
Variant string `json:"architectureVariant,omitempty"`
|
||||
OS string `json:"os"`
|
||||
Labels map[string]string `json:"labels,omitempty"`
|
||||
}
|
||||
|
||||
// StereoscopeLayerMetadata represents all static metadata that defines what a container image layer is.
|
||||
@@ -48,6 +49,7 @@ func NewStereoscopeImageMetadata(img *image.Image, userInput string) Stereoscope
|
||||
Architecture: img.Metadata.Architecture,
|
||||
Variant: img.Metadata.Variant,
|
||||
OS: img.Metadata.OS,
|
||||
Labels: img.Metadata.Config.Config.Labels,
|
||||
}
|
||||
|
||||
// populate image metadata
|
||||
|
||||
@@ -192,6 +192,7 @@ func imageMetadataFromStereoscopeImage(img *image.Image, reference string) Stere
|
||||
Architecture: img.Metadata.Architecture,
|
||||
Variant: img.Metadata.Variant,
|
||||
OS: img.Metadata.OS,
|
||||
Labels: img.Metadata.Config.Config.Labels,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user