Skip to content

Commit

Permalink
rhel: use repoid when present
Browse files Browse the repository at this point in the history
Signed-off-by: Hank Donnay <[email protected]>
  • Loading branch information
hdonnay committed Jan 12, 2024
1 parent 0020b67 commit 9e040ff
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions rhel/coalescer.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package rhel

import (
"context"
"net/url"

"github.com/quay/claircore"
"github.com/quay/claircore/indexer"
Expand Down Expand Up @@ -116,10 +117,15 @@ func (*Coalescer) Coalesce(ctx context.Context, artifacts []*indexer.LayerArtifa
PackageDB: pkg.PackageDB,
IntroducedIn: layerArtifacts.Hash,
DistributionID: distID,
RepositoryIDs: make([]string, len(layerArtifacts.Repos)),
}
for i := range layerArtifacts.Repos {
environment.RepositoryIDs[i] = layerArtifacts.Repos[i].ID
v, _ := url.ParseQuery(pkg.RepositoryHint) // Ignore error
if id := v.Get("repoid"); id != "" {
environment.RepositoryIDs = v["repoid"]

Check warning on line 123 in rhel/coalescer.go

View check run for this annotation

Codecov / codecov/patch

rhel/coalescer.go#L123

Added line #L123 was not covered by tests
} else {
environment.RepositoryIDs = make([]string, len(layerArtifacts.Repos))
for i := range layerArtifacts.Repos {
environment.RepositoryIDs[i] = layerArtifacts.Repos[i].ID
}
}
db.packages[pkg.ID] = pkg
db.environments[pkg.ID] = environment
Expand Down

0 comments on commit 9e040ff

Please sign in to comment.