Skip to content

Commit 5a04fb9

Browse files
committed
indexer: align affectedManifests call with matcher definitions
This change attempts to make the matching process consistent across both the vulnerability matching and the manifest matching that is performed by the affectedManifests logic. It reduces the number of queries to 1 per matcher per vulnerability. Signed-off-by: crozzy <[email protected]>
1 parent f5a19a4 commit 5a04fb9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+15840
-774
lines changed

alpine/matcher.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ func (*Matcher) Filter(record *claircore.IndexRecord) bool {
3535
}
3636

3737
// Query implements driver.Matcher.
38-
func (*Matcher) Query() []driver.MatchConstraint {
39-
return []driver.MatchConstraint{
40-
driver.DistributionDID,
41-
driver.DistributionName,
42-
driver.DistributionPrettyName,
38+
func (*Matcher) Query() []claircore.MatchConstraint {
39+
return []claircore.MatchConstraint{
40+
claircore.DistributionDID,
41+
claircore.DistributionName,
42+
claircore.DistributionPrettyName,
4343
}
4444
}
4545

aws/matcher.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ func (*Matcher) Filter(record *claircore.IndexRecord) bool {
3636
return false
3737
}
3838

39-
func (*Matcher) Query() []driver.MatchConstraint {
40-
return []driver.MatchConstraint{
41-
driver.DistributionDID,
42-
driver.DistributionVersionID,
39+
func (*Matcher) Query() []claircore.MatchConstraint {
40+
return []claircore.MatchConstraint{
41+
claircore.DistributionDID,
42+
claircore.DistributionVersionID,
4343
}
4444
}
4545

datastore/postgres/affected_manifests_e2e_test.go

Lines changed: 0 additions & 292 deletions
This file was deleted.

0 commit comments

Comments
 (0)