Skip to content

Commit d05ceb8

Browse files
committed
Add conformance test coverage for data field
Signed-off-by: Jason Hall <[email protected]>
1 parent dd38b7e commit d05ceb8

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

conformance/image.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ type Descriptor struct {
3535
// Size specifies the size in bytes of the blob.
3636
Size int64 `json:"size"`
3737

38+
// Data specifies the data of the object described by the descriptor.
39+
Data []byte `json:"data"`
40+
3841
// NewUnspecifiedField is not covered by image-spec.
3942
// Registry implementations should still successfully store and serve
4043
// manifests containing this data.

conformance/setup.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,8 @@ func init() {
228228
MediaType: "application/vnd.oci.image.config.v1+json",
229229
Digest: godigest.Digest(configs[i].Digest),
230230
Size: int64(len(configs[i].Content)),
231-
NewUnspecifiedField: configs[i].Content,
231+
Data: configs[i].Content, // must be the config content.
232+
NewUnspecifiedField: []byte("hello world"), // content doesn't matter.
232233
},
233234
Layers: layers,
234235
}
@@ -258,7 +259,8 @@ func init() {
258259
MediaType: "application/vnd.oci.image.config.v1+json",
259260
Digest: godigest.Digest(configs[1].Digest),
260261
Size: int64(len(configs[1].Content)),
261-
NewUnspecifiedField: configs[1].Content,
262+
Data: configs[1].Content, // must be the config content.
263+
NewUnspecifiedField: []byte("hello world"), // content doesn't matter.
262264
},
263265
Layers: []Descriptor{},
264266
}

0 commit comments

Comments
 (0)