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

@ -99,17 +99,21 @@ func detectCompressionType(cr io.Reader) (Type, error) {
}
var toDockerLayerType = map[string]string{
ocispec.MediaTypeImageLayer: images.MediaTypeDockerSchema2Layer,
images.MediaTypeDockerSchema2Layer: images.MediaTypeDockerSchema2Layer,
ocispec.MediaTypeImageLayerGzip: images.MediaTypeDockerSchema2LayerGzip,
images.MediaTypeDockerSchema2LayerGzip: images.MediaTypeDockerSchema2LayerGzip,
ocispec.MediaTypeImageLayer: images.MediaTypeDockerSchema2Layer,
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{
ocispec.MediaTypeImageLayer: ocispec.MediaTypeImageLayer,
images.MediaTypeDockerSchema2Layer: ocispec.MediaTypeImageLayer,
ocispec.MediaTypeImageLayerGzip: ocispec.MediaTypeImageLayerGzip,
images.MediaTypeDockerSchema2LayerGzip: ocispec.MediaTypeImageLayerGzip,
ocispec.MediaTypeImageLayer: ocispec.MediaTypeImageLayer,
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 {