Skip to content

Commit 1f45682

Browse files
committed
periodic: update layer handling
Signed-off-by: Hank Donnay <[email protected]>
1 parent bd65e5d commit 1f45682

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

test/periodic/rpm_test.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import (
1515

1616
"github.com/quay/claircore"
1717
"github.com/quay/claircore/rpm"
18+
"github.com/quay/claircore/test"
1819
"github.com/quay/claircore/test/fetch"
1920
"github.com/quay/claircore/test/rpmtest"
2021
)
@@ -190,13 +191,18 @@ func (doc hydraDoc) Run(dir string) func(*testing.T) {
190191
var got []*claircore.Package
191192
var which claircore.Digest
192193
for _, ld := range image.Data[0].Parsed.Layers {
194+
// TODO(hank) Need a way to use the nicer API, but pass the
195+
// Integration bypass.
193196
n, err := fetch.Layer(ctx, t, pkgClient, doc.Registry, doc.Repository, ld, fetch.IgnoreIntegration)
194197
if err != nil {
195198
t.Fatal(err)
196199
}
197200
defer n.Close()
198-
l := claircore.Layer{Hash: ld}
199-
l.SetLocal(n.Name())
201+
var l claircore.Layer
202+
if err := l.Init(ctx, &test.AnyDescription, n); err != nil {
203+
t.Fatal(err)
204+
}
205+
l.Hash = ld // If you're reading this for an example of how to work with layers: don't do this.
200206

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

0 commit comments

Comments
 (0)