concourse / registry-image-resource

a resource for images in a Docker registry
Apache License 2.0
89 stars 107 forks source link

Properly handle whiteout opaque dirs when unpacking #284

Closed EstebanFS closed 3 years ago

EstebanFS commented 3 years ago

Fixes #267

If a file in the layer tarball is labeled foo/.wh..wh..opq, that indicates that the existing contents of the directory foo/ should be emptied. We were previously treating this the same as normal whiteout files (e.g. foo/.wh.myfile means delete foo/myfile), which doesn't work properly (for opaque directory labels).

With this commit, we're now able to delete a directory and recreate it in the same layer, and have it be unpacked properly.

Signed-off-by: Esteban Foronda eforonda@vmware.com Co-authored-by: Aidan Oldershaw aoldershaw@pivotal.io