Skip to content

crane: export drops symlinks #2244

@nvsmirnov

Description

@nvsmirnov

Describe the bug

crane export in 0.21.3 drops symlinks while export to tar.

No problem at least with 0.21.1.

This looks similar to #2238,
but the scope there is defined as flatten with absolute symlinks, and there is a PR for exactly that case, so I decided to make separate issue.

To Reproduce

I did something like this:

Old crane:

> crane-old version
0.21.1
> crane-old export --insecure IMAGE | tar -tvf - app/node_modules/.bin
drwxr-xr-x 0/0               0 2026-03-23 19:38 app/node_modules/.bin
lrwxrwxrwx 0/0               0 2026-03-23 19:38 app/node_modules/.bin/acorn -> ../acorn/bin/acorn
# long list of symlinks follows

New crane, on same image, same environment:

> crane-new version
0.21.3
> crane-new export --insecure IMAGE | tar -tvf - app/node_modules/.bin
drwxr-xr-x 0/0               0 2026-03-23 19:38 app/node_modules/.bin
# above is full output for this case

Expected behavior

Symlinks must be in place.

Additional context

My environment is semi-closed, so I can't give examples which are publicly accessible, but I believe it is easy to reproduce.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions