Skip to content

Conversation

@majiayu000
Copy link

Fixes #1141

Changes

  • Add filterNamespaces function to support glob patterns (e.g., group*, main.*) in the --namespace flag
  • Uses Go's filepath.Match for pattern matching with support for *, ?, and [...]
  • Add unit tests for the new filtering function
  • Add integration test for wildcard namespace usage

Add wildcard/glob pattern matching support for the --namespace flag,
allowing users to match multiple namespaces with patterns like
'group*' instead of specifying each namespace individually.

The implementation uses filepath.Match for pattern matching, which
supports standard glob patterns including *, ?, and character classes.
Backward compatibility is maintained - exact namespace matches still
work as before.

Fixes open-policy-agent#1141

Signed-off-by: majiayu000 <[email protected]>
@jalseth
Copy link
Member

jalseth commented Jan 11, 2026

Dupe of #1247

@jalseth jalseth closed this Jan 11, 2026
@majiayu000 majiayu000 deleted the fix-1141-request-support-wildcards-in---0102-0253 branch January 11, 2026 05:30
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.

Request: Support wildcards in --namespace

2 participants