From d05ceb8ad4b035f78d80ec1ff1275fb8e83f2643 Mon Sep 17 00:00:00 2001 From: Jason Hall Date: Thu, 3 Mar 2022 13:28:07 -0500 Subject: [PATCH] Add conformance test coverage for data field Signed-off-by: Jason Hall --- conformance/image.go | 3 +++ conformance/setup.go | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/conformance/image.go b/conformance/image.go index 1a0600a7..d00fad6a 100644 --- a/conformance/image.go +++ b/conformance/image.go @@ -35,6 +35,9 @@ type Descriptor struct { // Size specifies the size in bytes of the blob. Size int64 `json:"size"` + // Data specifies the data of the object described by the descriptor. + Data []byte `json:"data"` + // NewUnspecifiedField is not covered by image-spec. // Registry implementations should still successfully store and serve // manifests containing this data. diff --git a/conformance/setup.go b/conformance/setup.go index 95e801bb..9d20caeb 100644 --- a/conformance/setup.go +++ b/conformance/setup.go @@ -228,7 +228,8 @@ func init() { MediaType: "application/vnd.oci.image.config.v1+json", Digest: godigest.Digest(configs[i].Digest), Size: int64(len(configs[i].Content)), - NewUnspecifiedField: configs[i].Content, + Data: configs[i].Content, // must be the config content. + NewUnspecifiedField: []byte("hello world"), // content doesn't matter. }, Layers: layers, } @@ -258,7 +259,8 @@ func init() { MediaType: "application/vnd.oci.image.config.v1+json", Digest: godigest.Digest(configs[1].Digest), Size: int64(len(configs[1].Content)), - NewUnspecifiedField: configs[1].Content, + Data: configs[1].Content, // must be the config content. + NewUnspecifiedField: []byte("hello world"), // content doesn't matter. }, Layers: []Descriptor{}, }