mirror of
https://github.com/anchore/syft.git
synced 2026-10-31 06:26:30 +01:00
Add deep-squashed scope to annotate all layers where a package exists (#3138)
* add squash all layers resolver Signed-off-by: tomersein <tomersein@gmail.com> * squashed all layers Signed-off-by: tomersein <tomersein@gmail.com> * squashed all layers Signed-off-by: tomersein <tomersein@gmail.com> * squashed all layers Signed-off-by: tomersein <tomersein@gmail.com> * squashed all layers Signed-off-by: tomersein <tomersein@gmail.com> * add squash with all layers logic Signed-off-by: tomersein <tomersein@gmail.com> * add squash with all layers logic Signed-off-by: tomersein <tomersein@gmail.com> * squashed all layers Signed-off-by: tomersein <tomersein@gmail.com> * squashed all layers Signed-off-by: tomersein <tomersein@gmail.com> * squashed all layers Signed-off-by: tomersein <tomersein@gmail.com> * squashed all layers Signed-off-by: tomersein <tomersein@gmail.com> * squashed all layers Signed-off-by: tomersein <tomersein@gmail.com> * squashed all layers Signed-off-by: tomersein <tomersein@gmail.com> * squashed all layers Signed-off-by: tomersein <tomersein@gmail.com> * squashed all layers Signed-off-by: tomersein <tomersein@gmail.com> * squashed all layers Signed-off-by: tomersein <tomersein@gmail.com> * squashed all layers Signed-off-by: tomersein <tomersein@gmail.com> * squashed all layers Signed-off-by: tomersein <tomersein@gmail.com> * squashed all layers Signed-off-by: tomersein <tomersein@gmail.com> * squashed all layers Signed-off-by: tomersein <tomersein@gmail.com> * squashed all layers Signed-off-by: tomersein <tomersein@gmail.com> * squash with all layers Signed-off-by: tomersein <tomersein@gmail.com> * squash with all layers Signed-off-by: tomersein <tomersein@gmail.com> * adjust resolver to strictly return squash paths only Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com> * show all packages have locations + primary evidence Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com> * fix race condition in test Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com> * consider access paths Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com> --------- Signed-off-by: tomersein <tomersein@gmail.com> 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:
@@ -12,12 +12,15 @@ const (
|
||||
SquashedScope Scope = "squashed"
|
||||
// AllLayersScope indicates to catalog content on all layers, regardless if it is visible from the container at runtime.
|
||||
AllLayersScope Scope = "all-layers"
|
||||
// DeepSquashedScope indicates to catalog content on all layers, but only include content visible from the squashed filesystem representation.
|
||||
DeepSquashedScope Scope = "deep-squashed"
|
||||
)
|
||||
|
||||
// AllScopes is a slice containing all possible scope options
|
||||
var AllScopes = []Scope{
|
||||
SquashedScope,
|
||||
AllLayersScope,
|
||||
DeepSquashedScope,
|
||||
}
|
||||
|
||||
// ParseScope returns a scope as indicated from the given string.
|
||||
@@ -25,8 +28,10 @@ func ParseScope(userStr string) Scope {
|
||||
switch strings.ToLower(userStr) {
|
||||
case SquashedScope.String():
|
||||
return SquashedScope
|
||||
case "alllayers", AllLayersScope.String():
|
||||
case "all", "alllayers", AllLayersScope.String():
|
||||
return AllLayersScope
|
||||
case "deepsquashed", "squasheddeep", "squashed-deep", "deep-squash", "deepsquash", strings.ToLower(DeepSquashedScope.String()):
|
||||
return DeepSquashedScope
|
||||
}
|
||||
return UnknownScope
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user