mirror of
https://github.com/anchore/syft.git
synced 2026-11-04 00:16:38 +01:00
Add support for dependency relationships for alpine (apk) (#1063)
* Fix type of pull deps and add support for provides Signed-off-by: Dan Luhring <dan+github@luhrings.com> * [wip] apk dependency lookup Signed-off-by: Alex Goodman <alex.goodman@anchore.com> * update whitespace for linter Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com> * adjust test conditions Signed-off-by: Timothy Gerla <tim@gerla.net> * fix TODOs and improve Provides parser * run simports after main merge Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com> * add tests to cover apk relationship parsing cases Signed-off-by: Alex Goodman <alex.goodman@anchore.com> * generate JSON schema for breaking changes to apk metadata Signed-off-by: Alex Goodman <alex.goodman@anchore.com> * update tests to account for additional dependencies Signed-off-by: Alex Goodman <alex.goodman@anchore.com> * [wip] fix relationship encoding for cyclonedx Signed-off-by: Alex Goodman <alex.goodman@anchore.com> * simplify package relationships that can be expressed Signed-off-by: Alex Goodman <alex.goodman@anchore.com> Signed-off-by: Dan Luhring <dan+github@luhrings.com> Signed-off-by: Alex Goodman <alex.goodman@anchore.com> Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com> Signed-off-by: Timothy Gerla <tim@gerla.net> Co-authored-by: Alex Goodman <alex.goodman@anchore.com> Co-authored-by: Christopher Phillips <christopher.phillips@anchore.com> Co-authored-by: Timothy Gerla <tim@gerla.net>
This commit is contained in:
co-authored by
Alex Goodman
Christopher Phillips
Timothy Gerla
parent
e58d0aecb8
commit
949cff158d
@@ -186,16 +186,10 @@ func toSyftRelationships(spdxIDMap map[string]interface{}, doc *spdx.Document2_2
|
||||
case ContainsRelationship:
|
||||
typ = artifact.ContainsRelationship
|
||||
to = toPackage
|
||||
case BuildDependencyOfRelationship:
|
||||
typ = artifact.BuildDependencyOfRelationship
|
||||
to = toPackage
|
||||
case RuntimeDependencyOfRelationship:
|
||||
typ = artifact.RuntimeDependencyOfRelationship
|
||||
to = toPackage
|
||||
case OtherRelationship:
|
||||
// Encoding uses a specifically formatted comment...
|
||||
if strings.Index(r.RelationshipComment, string(artifact.OwnershipByFileOverlapRelationship)) == 0 {
|
||||
typ = artifact.RuntimeDependencyOfRelationship
|
||||
typ = artifact.DependencyOfRelationship
|
||||
to = toPackage
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user