Skip to content

Commit 69ba836

Browse files
committed
rhel: use repoid when present
Signed-off-by: Hank Donnay <[email protected]>
1 parent 87420a5 commit 69ba836

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

rhel/coalescer.go

+9-3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package rhel
22

33
import (
44
"context"
5+
"net/url"
56

67
"github.com/quay/claircore"
78
"github.com/quay/claircore/indexer"
@@ -116,10 +117,15 @@ func (*Coalescer) Coalesce(ctx context.Context, artifacts []*indexer.LayerArtifa
116117
PackageDB: pkg.PackageDB,
117118
IntroducedIn: layerArtifacts.Hash,
118119
DistributionID: distID,
119-
RepositoryIDs: make([]string, len(layerArtifacts.Repos)),
120120
}
121-
for i := range layerArtifacts.Repos {
122-
environment.RepositoryIDs[i] = layerArtifacts.Repos[i].ID
121+
v, _ := url.ParseQuery(pkg.RepositoryHint) // Ignore error
122+
if id := v.Get("repoid"); id != "" {
123+
environment.RepositoryIDs = v["repoid"]
124+
} else {
125+
environment.RepositoryIDs = make([]string, len(layerArtifacts.Repos))
126+
for i := range layerArtifacts.Repos {
127+
environment.RepositoryIDs[i] = layerArtifacts.Repos[i].ID
128+
}
123129
}
124130
db.packages[pkg.ID] = pkg
125131
db.environments[pkg.ID] = environment

0 commit comments

Comments
 (0)