handle foreign mediatypes on push

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
v0.8
Tonis Tiigi 2020-12-05 23:16:44 -08:00
parent 0af7b1b9c6
commit aabdec1778
1 changed files with 12 additions and 8 deletions

View File

@ -103,6 +103,8 @@ var toDockerLayerType = map[string]string{
images.MediaTypeDockerSchema2Layer: images.MediaTypeDockerSchema2Layer,
ocispec.MediaTypeImageLayerGzip: images.MediaTypeDockerSchema2LayerGzip,
images.MediaTypeDockerSchema2LayerGzip: images.MediaTypeDockerSchema2LayerGzip,
images.MediaTypeDockerSchema2LayerForeign: images.MediaTypeDockerSchema2Layer,
images.MediaTypeDockerSchema2LayerForeignGzip: images.MediaTypeDockerSchema2LayerGzip,
}
var toOCILayerType = map[string]string{
@ -110,6 +112,8 @@ var toOCILayerType = map[string]string{
images.MediaTypeDockerSchema2Layer: ocispec.MediaTypeImageLayer,
ocispec.MediaTypeImageLayerGzip: ocispec.MediaTypeImageLayerGzip,
images.MediaTypeDockerSchema2LayerGzip: ocispec.MediaTypeImageLayerGzip,
images.MediaTypeDockerSchema2LayerForeign: ocispec.MediaTypeImageLayer,
images.MediaTypeDockerSchema2LayerForeignGzip: ocispec.MediaTypeImageLayerGzip,
}
func convertLayerMediaType(mediaType string, oci bool) string {