concourse / registry-image-resource

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

Uid&Gid info lost for emptied directory while unpack image #324

Closed SimonXming closed 2 years ago

SimonXming commented 2 years ago

If a emptied directory created in Dockerfile, it will not chown to restore the origin uid&gid during unpack image. This was handled by tarfs.ExtractEntry

Signed-off-by: Ming Xu mingx@vmware.com

xtremerui commented 2 years ago

There is test failure on both checks, you might want to fix those

#24 8.282 github.com/concourse/registry-image-resource/in_test.go:26
#24 8.282   removed files in layers
#24 8.282   github.com/concourse/registry-image-resource/in_test.go:179
#24 8.282     does not restore files that were removed in later layers [It]
#24 8.282     github.com/concourse/registry-image-resource/in_test.go:188
#24 8.282 
#24 8.282     Unexpected error:
#24 8.282         <*fs.PathError | 0xc0005dea50>: {
#24 8.282             Op: "stat",
#24 8.282             Path: "/tmp/docker-image-in-dir566841923/rootfs/top-dir-4",
#24 8.282             Err: <syscall.Errno>0x2,
#24 8.282         }
#24 8.282         stat /tmp/docker-image-in-dir566841923/rootfs/top-dir-4: no such file or directory
#24 8.282     occurred
SimonXming commented 2 years ago

There is test failure on both checks, you might want to fix those

I think it's because testdata/whiteout/Dockerfile get changed in the PR (adding new directory rootfs/top-dir-4), but the concourse/test-image-whiteout image which used in the unit test not updated with modified Dockerfile in the PR. These two failure should be fixed once concourse/test-image-whiteout image get updated.