add --image-format flag to pin output media type#850
Conversation
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
|
Moving back to draft. So forcing The fix is to relabel every layer descriptor too, not just the manifest and config. The relabel is descriptor-only and compression-preserving so blob bytes and digests do not change, with the one caveat that a zstd OCI base cannot be represented in a docker manifest and has to error rather than convert. The mz851 work added a |
fixes #849.
Kaniko's output media type is currently decided by whatever the base image happens to be, with a Docker schema2 fallback. That is outside the user's control and changes silently when a registry re-publishes a tag in a different format, which makes the output format unpredictable. This adds
--image-format=docker|ociso the output format is an explicit, stable choice. The format is forced at a single chokepoint innewStageBuilder, so it propagates to every stage includingFROM scratchand subsumesFF_KANIKO_OCI_SCRATCH_BASE.This is phase 1 of the migration: the flag is purely additive and the unset default keeps today's inherit-from-base behavior, so existing builds are bit-for-bit unchanged. The default flip to
ociis a later phase tracked on #849.