Proposal: Support RegEx as an Alternative to Doublestar - #298
Open
Vad1mo wants to merge 3 commits into
Open
Conversation
Adds regular expressions (Go RE2) as a second, user-selectable pattern engine next to doublestar in Harbor's pattern-based filters (retention, immutability, replication, P2P preheat). Doublestar stays the default; each pattern field gets an explicit engine selector, so existing rules are unaffected. Builds on the direction agreed in goharbor#221, the reference implementation goharbor/harbor#18723, and the kind discriminator introduced by goharbor#280. Addresses goharbor/harbor#12877 and goharbor/harbor#8614. Signed-off-by: Vadim Bauer <vb@container-registry.com>
Harmonizes with the kind discriminator community PR goharbor#280 introduces for the proxy-cache repository filter, so Harbor ships one vocabulary (doublestar | regex) instead of two. Resolves the open issue. Signed-off-by: Vadim Bauer <vb@container-registry.com>
Measured on an unpatched build: an immutability rule with an unknown selector kind saves with 200, populateImmutableStatus swallows the matcher error, every tag reports Immutable=false and a push overwrites a supposedly immutable tag with no error surfacing anywhere. Retention by contrast fails closed and loudly. Split the downgrade caveat accordingly and promote save-time validation for immutability from hygiene to a safety requirement, including fixing the error swallowing as part of phase 1. Signed-off-by: Vadim Bauer <vb@container-registry.com>
This was referenced Aug 27, 2026
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.
Proposal to add regular expressionsas a second, user-selectable pattern next to the existing doublestar glob matching in Harbor's pattern-based filters: tag retention, tag immutability, replication, and P2P preheat.
RegEx is an addition, not a replacement: every pattern field gets an explicit engine selector defaulting to Doublestar, so users pick per filter whichever engine fits and no existing rule changes behavior.
I am creating a new proposal, since there was quite some feedback and ideas around that over time and this proposal tries ot incorperate them all under one roof.
Why
kind: regex|doublestardiscriminator Add proxy cache filter proposal #280 introduces for the proxy-cache filter.Highlights
regexpselector kind insrc/lib/selector/selectors/, used by all four surfaces; phased rollout (retention + immutability first — no DB migration needed).Refs: goharbor/harbor#12877, goharbor/harbor#8614