Commit Graph

3 Commits

Author SHA1 Message Date
Aditya Rajan a74add5b50
stage_executor: re-use all possible layers from cache for squashed builds
Re-use all the layers from cache for squashed case and commit as late as possible

Current implementation of marking for re-use of cache `commits` on every
`stage` when used with `--squashed` however we should try to re-use as
many layers are possible if `--layers` is specified and `commit` only on
`last instruction` of `last stage` to perform final squash.

Also treat all other layers as if they are being written for regular
build and write them cache.

Signed-off-by: Aditya Rajan <arajan@redhat.com>
2021-12-15 17:04:26 +05:30
Nalin Dahyabhai e2dc7ec6a4 copier.Get(): hard link targets shouldn't be relative paths
When adding a hard link entry to an archive, don't try to make the path
of the link's target name be relative to the link's location in the
filesystem if they're in the same directory, since receivers don't
interpret it that way.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2020-09-08 18:09:15 -04:00
Nalin Dahyabhai cc80ccc252 makeImageRef: ignore EmptyLayer if Squash is set
If Squash is set, then we're only committing one layer, so if EmptyLayer
is set, which would normally tell us to skip committing the final layer,
we should ignore the EmptyLayer flag.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>

Closes: #1839
Approved by: TomSweeneyRedHat
2019-09-04 23:00:41 +00:00