buildkit/client
Erik Sipsma 0a2a4fe066 diffApply: set dir opaque when overwriting whiteout
Before this, there was a bug triggered under the following conditions:
1. An overlay snapshotter was being used, which caused the optimization
   of preparing a new snapshot off of the base layers to be triggered
2. The base layers contained a directory that had contents
3. One subsequent layer deleted that directory w/out recreating it
4. A later layer recreated the directory

In this case, what happened was a whiteout device would be created as
part of 3 above but then in step 4 the whiteout device would be removed
and replaced with a plain directory. The problem is that such a
directory doesn't block out the files from step 2 and it doesn't know
about them because they are in a lowerdir (not the upperdir being
applied to).

The simplest fix, which this commit implements, is to just set the
directory created in step 4 as opaque, which enables the correct
behavior of blocking out files below it.

This was missed in test coverage before because tests for opaque
handling always combined 3+4 into one layer, whereas the bug requires
they be separate layers. A new integration test has been added to cover
this case.

Signed-off-by: Erik Sipsma <erik@sipsma.dev>
2022-02-09 20:15:11 -08:00
..
buildid allow frontends to be run directly on the control client side 2018-08-14 11:50:08 +01:00
connhelper new connection helper: podman-container://<CONTAINER> 2020-08-06 15:38:16 +09:00
llb Add support for progress groups. 2022-02-08 11:27:49 -08:00
ociindex all: unify the specs-go package import alias to ocispecs 2021-08-11 08:29:09 +09:00
build.go support setting warnings from frontends 2021-11-24 00:19:43 -08:00
build_test.go Allow signals to be sent to gateway exec containers 2022-02-02 16:57:10 +00:00
client.go Bump github.com/containerd/containerd to v1.6.0-rc.1 2022-01-28 10:18:59 +01:00
client_test.go exec: allow mounting secret environment variables 2022-01-31 11:22:57 -08:00
client_unix.go go fmt: add //go:build 2021-10-28 13:26:43 +02:00
client_windows.go client: update dialer to contextDialer 2020-07-19 09:28:36 -07:00
diskusage.go Add initial MergeOp implementation. 2021-11-18 11:10:48 -08:00
exporters.go exporter: add tar exporter 2019-03-27 09:40:24 -07:00
filter.go client: generalize the filter passing 2018-07-25 18:19:31 -07:00
graph.go Add support for progress groups. 2022-02-08 11:27:49 -08:00
mergediff_linux_test.go Add DiffOp test cases. 2022-01-06 11:05:51 -08:00
mergediff_nolinux_test.go Add DiffOp test cases. 2022-01-06 11:05:51 -08:00
mergediff_test.go diffApply: set dir opaque when overwriting whiteout 2022-02-09 20:15:11 -08:00
prune.go Add initial MergeOp implementation. 2021-11-18 11:10:48 -08:00
solve.go Add support for progress groups. 2022-02-08 11:27:49 -08:00
workers.go all: unify the specs-go package import alias to ocispecs 2021-08-11 08:29:09 +09:00