buildpacks / imgutil

Helpful utilities for working with images
Apache License 2.0
23 stars 41 forks source link

Ensure we always normalize history before saving #269

Closed natalieparellano closed 3 months ago

natalieparellano commented 3 months ago

Prior to this commit, we were normalizing history whenever layers were added (either via AddLayer or ReuseLayer), but when rebasing, if the new base image has empty layer history, the information about the empty/non-empty aspect of the history will be lost if "preserve history" isn't set on the image.

Prior to the "v1 refactor" in https://github.com/buildpacks/imgutil/pull/257 we were also normalizing history before saving, so this is restoring previous behavior.