Add a FollowSymlink option to AddAndCopyOptions to allow disabling deference of symlinks#6760
Open
BenjaminSchubert wants to merge 1 commit into
Open
Conversation
cb50e3e to
d1763a9
Compare
d1763a9 to
df53e2d
Compare
nalind
requested changes
Apr 27, 2026
Member
nalind
left a comment
There was a problem hiding this comment.
Code and tests look good. The docs should probably be a bit more specific, since this doesn't affect symlinks in directories the way a similar flag might for the regular cp command from coreutils.
00b562e to
5609eed
Compare
5609eed to
1d34125
Compare
nalind
approved these changes
May 18, 2026
Member
nalind
left a comment
There was a problem hiding this comment.
LGTM
@containers/buildah-maintainers PTAL
giuseppe
reviewed
May 19, 2026
| **--no-follow-symlinks** | ||
|
|
||
| When a local source is a symbolic link, copy the link as a symbolic link | ||
| instead of dereferencing the link and copying the contents of the target |
Member
There was a problem hiding this comment.
nit: missing .. at the end of the sentence
Contributor
Author
There was a problem hiding this comment.
Good catch, fixed
This allows disabling deference of symlinks when copying files into a container Signed-off-by: Benjamin Schubert <bschubert15@bloomberg.net>
1d34125 to
792524a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What type of PR is this?
What this PR does / why we need it:
This PR adds the ability to skip the dereference of symlinks when doing a ADD or COPY.
Depends on #6759
How to verify it
See the bats tests provided
Which issue(s) this PR fixes:
Fixes #6737
Special notes for your reviewer:
Does this PR introduce a user-facing change?