Skip to content

Commit

Permalink
Merge pull request #790 from vrothberg/add-zstd-constants
Browse files Browse the repository at this point in the history
zstd: add constants to specs-go/v1
  • Loading branch information
vbatts authored Aug 23, 2019
2 parents 9f4348a + c3a73dc commit 775207b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
4 changes: 3 additions & 1 deletion schema/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,10 @@ func validateManifest(r io.Reader) error {
for _, layer := range header.Layers {
if layer.MediaType != string(v1.MediaTypeImageLayer) &&
layer.MediaType != string(v1.MediaTypeImageLayerGzip) &&
layer.MediaType != string(v1.MediaTypeImageLayerZstd) &&
layer.MediaType != string(v1.MediaTypeImageLayerNonDistributable) &&
layer.MediaType != string(v1.MediaTypeImageLayerNonDistributableGzip) {
layer.MediaType != string(v1.MediaTypeImageLayerNonDistributableGzip) &&
layer.MediaType != string(v1.MediaTypeImageLayerNonDistributableZstd) {
fmt.Printf("warning: layer %s has an unknown media type: %s\n", layer.Digest, layer.MediaType)
}
}
Expand Down
9 changes: 9 additions & 0 deletions specs-go/v1/mediatype.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ const (
// referenced by the manifest.
MediaTypeImageLayerGzip = "application/vnd.oci.image.layer.v1.tar+gzip"

// MediaTypeImageLayerZstd is the media type used for zstd compressed
// layers referenced by the manifest.
MediaTypeImageLayerZstd = "application/vnd.oci.image.layer.v1.tar+zstd"

// MediaTypeImageLayerNonDistributable is the media type for layers referenced by
// the manifest but with distribution restrictions.
MediaTypeImageLayerNonDistributable = "application/vnd.oci.image.layer.nondistributable.v1.tar"
Expand All @@ -43,6 +47,11 @@ const (
// restrictions.
MediaTypeImageLayerNonDistributableGzip = "application/vnd.oci.image.layer.nondistributable.v1.tar+gzip"

// MediaTypeImageLayerNonDistributableZstd is the media type for zstd
// compressed layers referenced by the manifest but with distribution
// restrictions.
MediaTypeImageLayerNonDistributableZstd = "application/vnd.oci.image.layer.nondistributable.v1.tar+zstd"

// MediaTypeImageConfig specifies the media type for the image configuration.
MediaTypeImageConfig = "application/vnd.oci.image.config.v1+json"
)

0 comments on commit 775207b

Please sign in to comment.