crane/flatten: preserve image media type when flattening by alliasgher · Pull Request #2267 · google/go-containerregistry (original) (raw)
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
Subserial pushed a commit to Subserial/go-containerregistry that referenced this pull request
- crane/flatten: preserve image media type when flattening
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
- crane/flatten: add media type preservation test
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 }})