Skip to content

Commit

Permalink
periodic: update layer handling
Browse files Browse the repository at this point in the history
Signed-off-by: Hank Donnay <hdonnay@redhat.com>
  • Loading branch information
hdonnay committed Sep 14, 2023
1 parent 6555756 commit 55cf8b0
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions test/periodic/rpm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (

"github.com/quay/claircore"
"github.com/quay/claircore/rpm"
"github.com/quay/claircore/test"
"github.com/quay/claircore/test/fetch"
"github.com/quay/claircore/test/rpmtest"
)
Expand Down Expand Up @@ -190,13 +191,18 @@ func (doc hydraDoc) Run(dir string) func(*testing.T) {
var got []*claircore.Package
var which claircore.Digest
for _, ld := range image.Data[0].Parsed.Layers {
// TODO(hank) Need a way to use the nicer API, but pass the
// Integration bypass.
n, err := fetch.Layer(ctx, t, pkgClient, doc.Registry, doc.Repository, ld, fetch.IgnoreIntegration)
if err != nil {
t.Fatal(err)
}
defer n.Close()
l := claircore.Layer{Hash: ld}
l.SetLocal(n.Name())
var l claircore.Layer
if err := l.Init(ctx, &test.AnyDescription, n); err != nil {
t.Fatal(err)
}
l.Hash = ld // If you're reading this for an example of how to work with layers: don't do this.

pkgs, err := s.Scan(ctx, &l)
if err != nil {
Expand Down

0 comments on commit 55cf8b0

Please sign in to comment.