ggcr: mutate.Append
creates invalid images when appending duplicate layers (same diff ID) but different blob
#2034
Labels
bug
Something isn't working
Describe the bug
It's possible to mutate an image with a duplicate layer that has the same diff ID as a previous layer (from a parent image), but the underlying blob differs due to a difference in compression (e.g. level).
To Reproduce
Output (end):
Thus we see that
4f4fb700ef54461cfa02571ae0db9a0dc1e0cdb5577484a6d75e68dc38e8acc1
from the Docker build is missing and replaced with the one from Kaniko (both the empty layer, different compression result). This is a manifest<->layer inconsistency.Expected behavior
The mutation does one of the following:
Or perhaps something else should happen, I haven't researched the subject in-depth.
Additional context
This can easily be worked around outside the library by using
LayerByDiffID(...)
before callingmutate.Append
as done here: coder/kaniko@131d609. But I don't think it's a good idea to allow mutate to create invalid images.The text was updated successfully, but these errors were encountered: