osbase/oci: implement support for OCI index
Previously, only OCI images were supported, now we can also handle
indexes. The new Ref type is either an Image or Index.
Change-Id: I1b282ed6078d53e9a69e7613f601fdbbe64e192b
Reviewed-on: https://review.monogon.dev/c/monogon/+/4475
Tested-by: Jenkins CI
Reviewed-by: Tim Windelschmidt <tim@monogon.tech>
diff --git a/osbase/oci/oci_test.go b/osbase/oci/oci_test.go
index 93976ed..573771b 100644
--- a/osbase/oci/oci_test.go
+++ b/osbase/oci/oci_test.go
@@ -33,7 +33,7 @@
}`
// Pass nil for blobs, which means reading can only work if it uses the
// embedded content.
- image, err := NewImage([]byte(manifest), "", nil)
+ image, err := AsImage(NewRef([]byte(manifest), "application/vnd.oci.image.manifest.v1+json", "", nil))
if err != nil {
t.Fatal(err)
}