add/copy: support AllowWildcard and AllowEmptyWildcard#6843
Open
akca wants to merge 1 commit into
Open
Conversation
f8c12a8 to
96971cf
Compare
|
Ephemeral COPR build failed. @containers/packit-build please check. |
bca54ee to
f5656b9
Compare
f5656b9 to
80e1b5b
Compare
nalind
reviewed
May 18, 2026
Member
nalind
left a comment
There was a problem hiding this comment.
Very good overall. A question about the default for the allow-wildcard setting in the options structs in the copier package, and a couple of smaller questions around the tests.
80e1b5b to
f96056e
Compare
Expose --allow-wildcard and --allow-empty-wildcard on buildah add/copy, aligning with BuildKit's FileActionCopy flags. --allow-wildcard (default true) controls whether source paths may contain glob characters. When false, wildcards are rejected. --allow-empty-wildcard (default false) controls whether zero glob matches is an error. Individual empty wildcards are silently skipped, operation only fails when every source matches nothing. Signed-off-by: Fatih Akca <fatihakca5@gmail.com>
f96056e to
c3f527f
Compare
Member
|
@containers/buildah-maintainers PTAL |
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?
/kind feature
What this PR does / why we need it:
Adds
AllowWildcardandAllowEmptyWildcardto the copier's stat/get operations and exposes them as--allow-wildcard/--allow-empty-wildcardonbuildah addandbuildah copy, aligning with BuildKit'sFileActionCopyflags (ref).AllowWildcardcontrols whether glob patterns are allowed in source paths. Whenfalse, wildcards are rejected.buildah add/buildah copysets this totrueby default and preserves current behaviour.AllowEmptyWildcardcontrols what happens when a wildcard source matches no files. By default (false), the operation fails if every source comes up empty. With--allow-empty-wildcard=true, an empty result is silently accepted. Docker/BuildKit defaults totrue(ref), soCOPY nonexistent* /dest/silently succeeds in Docker but errors in buildah. If there's interest in matching Docker's default, that could be a follow-up PR since it would touch many more places.How to verify it
Which issue(s) this PR fixes:
Fixes #6828
Fixes #6829
Special notes for your reviewer:
boolfor these fields (no value provided = doesn't allow globs). Existing callers in buildah and podman all pass resolved paths without wildcard characters, so they should be unaffected.image.gois the only exception (exclusion patterns may contain wildcards), so it now explicitly setsAllowWildcard: true. Let me know if there are callers I missed.copy-multiple-some-missing-globandcopy-multiple-missing-file-with-nomatch-on-globverify the multi-source behaviour matches Docker.Does this PR introduce a user-facing change?