Skip to content

Commit

Permalink
Merge pull request #318 from imjasonh/data-field
Browse files Browse the repository at this point in the history
Add conformance test coverage for data field
  • Loading branch information
vbatts authored Aug 17, 2022
2 parents 31efc49 + d05ceb8 commit dce8d21
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions conformance/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 4 additions & 2 deletions conformance/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
Expand Down Expand Up @@ -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{},
}
Expand Down

0 comments on commit dce8d21

Please sign in to comment.