Skip to content

overlay: fix symlink-replacing-directory case#25

Merged
tycho merged 2 commits into
mainfrom
steven/overlay-symlink-whiteout
Apr 21, 2026
Merged

overlay: fix symlink-replacing-directory case#25
tycho merged 2 commits into
mainfrom
steven/overlay-symlink-whiteout

Conversation

@tycho
Copy link
Copy Markdown
Member

@tycho tycho commented Apr 21, 2026

This fixes several image pulls with GitLab CE images, where a symlink replaced a directory path.

Before:

$ ./target/release/ocirender pull --image registry.gitlab.com/gitlab-org/build/cng/gitlab-toolbox-ce:v18.9.2 --output-squashfs x.squashfs
Error: merging layers into mksquashfs stdin

Caused by:
    0: mksquashfs failed (status=exit status: 1):
       FATAL ERROR: /srv/gitlab/log exists in the tar file as a non-directory, cannot add tar pathname srv/gitlab/log/.gitkeep!

    1: emitting srv/gitlab/public/-/emojis/4/alarm_clock.png
    2: failed to append entry: Broken pipe (os error 32)

After:

$ ./target/release/ocirender pull --image registry.gitlab.com/gitlab-org/build/cng/gitlab-toolbox-ce:v18.9.2 --output-squashfs x.squashfs
Done: x.squashfs
$ unsquashfs -lls -lln x.squashfs | grep log/gitl
lrwxrwxrwx 0/0                      15 2026-03-10 11:28 squashfs-root/srv/gitlab/log -> /var/log/gitlab
drwxrwxr-x 1000/1000                31 2026-03-10 10:51 squashfs-root/var/log/gitlab
-rw-rw-r-- 1000/1000                 0 2026-03-10 10:51 squashfs-root/var/log/gitlab/.gitkeep

All tests passing, and two new tests added.

tycho added 2 commits April 21, 2026 14:47
Signed-off-by: Steven Noonan <steven@edera.dev>
Signed-off-by: Steven Noonan <steven@edera.dev>
@tycho tycho requested review from bleggett and kaniini April 21, 2026 21:52
@tycho tycho merged commit 283624e into main Apr 21, 2026
2 checks passed
@tycho tycho deleted the steven/overlay-symlink-whiteout branch April 21, 2026 22:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants