Skip to content

fix(imgutil): accept leading wildcards in reference filters - #5339

Open
peterolkhov wants to merge 1 commit into
containerd:mainfrom
peterolkhov:codex/accept-leading-wildcard-image-filters
Open

peterolkhov wants to merge 1 commit into
containerd:mainfrom
peterolkhov:codex/accept-leading-wildcard-image-filters

Conversation

@peterolkhov

Copy link
Copy Markdown

A valid reference glob such as *alpine* passes glob parsing, then fails because it is also parsed as a regular expression. Keep glob matching and use the optional regexp result only when regexp parsing succeeds. Malformed globs still return their original error.

Tests cover wildcard match-all, a nonmatching image before the target, no matches, regexp-only matching, invalid syntax, dangling images and multiple-pattern AND behavior. Package tests, make test-unit, make binaries, four-target Go lint, module lint and formatting passed locally. The CLI integration case compiles; it was not run against a daemon.

AI assistance: GPT-6.1 Sol with high reasoning.

Keep valid reference globs when optional regexp parsing fails. Preserve invalid
glob errors, regexp matching and all-pattern filtering.

Signed-off-by: Peter Olkhovets <peterolkhov@users.noreply.github.com>
Assisted-by: Codex (GPT-6.1 Sol, high reasoning)
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.

1 participant