mirror of
https://github.com/anchore/syft
synced 2024-11-10 06:14:16 +00:00
allow for RPM modularity to be optional (#2540)
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
This commit is contained in:
parent
ad2843bf50
commit
bf3cd9ed3b
5 changed files with 2174 additions and 20 deletions
|
@ -3,5 +3,5 @@ package internal
|
||||||
const (
|
const (
|
||||||
// JSONSchemaVersion is the current schema version output by the JSON encoder
|
// JSONSchemaVersion is the current schema version output by the JSON encoder
|
||||||
// This is roughly following the "SchemaVer" guidelines for versioning the JSON schema. Please see schema/json/README.md for details on how to increment.
|
// This is roughly following the "SchemaVer" guidelines for versioning the JSON schema. Please see schema/json/README.md for details on how to increment.
|
||||||
JSONSchemaVersion = "13.0.0"
|
JSONSchemaVersion = "14.0.0"
|
||||||
)
|
)
|
||||||
|
|
2148
schema/json/schema-14.0.0.json
Normal file
2148
schema/json/schema-14.0.0.json
Normal file
File diff suppressed because it is too large
Load diff
|
@ -66,7 +66,7 @@ func parseRpmDB(_ context.Context, resolver file.Resolver, env *generic.Environm
|
||||||
SourceRpm: entry.SourceRpm,
|
SourceRpm: entry.SourceRpm,
|
||||||
Vendor: entry.Vendor,
|
Vendor: entry.Vendor,
|
||||||
Size: entry.Size,
|
Size: entry.Size,
|
||||||
ModularityLabel: entry.Modularitylabel,
|
ModularityLabel: &entry.Modularitylabel,
|
||||||
Files: extractRpmFileRecords(resolver, *entry),
|
Files: extractRpmFileRecords(resolver, *entry),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -109,6 +109,7 @@ func TestParseRpmDB(t *testing.T) {
|
||||||
SourceRpm: "dive-0.9.2-1.src.rpm",
|
SourceRpm: "dive-0.9.2-1.src.rpm",
|
||||||
Size: 12406784,
|
Size: 12406784,
|
||||||
Vendor: "",
|
Vendor: "",
|
||||||
|
ModularityLabel: strRef(""),
|
||||||
Files: []pkg.RpmFileRecord{},
|
Files: []pkg.RpmFileRecord{},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -137,6 +138,7 @@ func TestParseRpmDB(t *testing.T) {
|
||||||
SourceRpm: "dive-0.9.2-1.src.rpm",
|
SourceRpm: "dive-0.9.2-1.src.rpm",
|
||||||
Size: 12406784,
|
Size: 12406784,
|
||||||
Vendor: "",
|
Vendor: "",
|
||||||
|
ModularityLabel: strRef(""),
|
||||||
Files: []pkg.RpmFileRecord{
|
Files: []pkg.RpmFileRecord{
|
||||||
{
|
{
|
||||||
Path: "/usr/local/bin/dive",
|
Path: "/usr/local/bin/dive",
|
||||||
|
@ -213,3 +215,7 @@ func TestToElVersion(t *testing.T) {
|
||||||
func intRef(i int) *int {
|
func intRef(i int) *int {
|
||||||
return &i
|
return &i
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func strRef(s string) *string {
|
||||||
|
return &s
|
||||||
|
}
|
||||||
|
|
|
@ -34,7 +34,7 @@ type RpmDBEntry struct {
|
||||||
SourceRpm string `json:"sourceRpm" cyclonedx:"sourceRpm"`
|
SourceRpm string `json:"sourceRpm" cyclonedx:"sourceRpm"`
|
||||||
Size int `json:"size" cyclonedx:"size"`
|
Size int `json:"size" cyclonedx:"size"`
|
||||||
Vendor string `json:"vendor"`
|
Vendor string `json:"vendor"`
|
||||||
ModularityLabel string `json:"modularityLabel"`
|
ModularityLabel *string `json:"modularityLabel,omitempty"`
|
||||||
Files []RpmFileRecord `json:"files"`
|
Files []RpmFileRecord `json:"files"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue