crane/flatten: preserve image media type when flattening by alliasgher · Pull Request #2267 · google/go-containerregistry (original) (raw)

@alliasgher mentioned this pull request

Apr 14, 2026

@alliasgher

Carry the original image's media type (OCI vs Docker) through to the flattened image so that an OCI image index does not end up referencing Docker-typed image manifests (and vice versa). Registries and tooling that assume an index and its children share the same media-type family reject the mixed result.

Signed-off-by: Ali alliasgher123@gmail.com

@alliasgher

Verifies that flattenImage carries the source image's media type (OCI or Docker) through to the flattened image. Fails against the pre-fix code for OCI inputs and passes for Docker.

Signed-off-by: Ali alliasgher123@gmail.com

@Subserial

Subserial

Subserial pushed a commit to Subserial/go-containerregistry that referenced this pull request

May 15, 2026

@alliasgher @Subserial

Carry the original image's media type (OCI vs Docker) through to the flattened image so that an OCI image index does not end up referencing Docker-typed image manifests (and vice versa). Registries and tooling that assume an index and its children share the same media-type family reject the mixed result.

Signed-off-by: Ali alliasgher123@gmail.com

Verifies that flattenImage carries the source image's media type (OCI or Docker) through to the flattened image. Fails against the pre-fix code for OCI inputs and passes for Docker.

Signed-off-by: Ali alliasgher123@gmail.com

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})