Skip to content

Conversation

@martinohmann
Copy link
Member

This implements the nice-to-have mentioned in #1.

In addition to matching and replacing image prefixes, this adds support
for using regexp patterns in exclusion and replacement rules.

This should allow to do any possible image transformation. When using a
regexp replacement rule, the replacement pattern can reference
submatches via $N where N is a number or ${name} where name is
the name of a named capture group (e.g. (?P<tag>.+)).

@martinohmann martinohmann requested a review from a team as a code owner March 28, 2022 08:01
In addition to matching and replacing image prefixes, this adds support
for using regexp patterns in exclusion and replacement rules.

This should allow to do any possible image transformation. When using a
regexp replacement rule, the replacement pattern can reference
submatches via `$N` where `N` is a number or `${name}` where `name` is
the name of a named capture group (e.g. `(?P<tag>.+)`).
@pesarkhobeee
Copy link
Contributor

I couldn't agree 100% percent with the logic. If we are going to support regex so why we should have our own way of defining rules too?
What I mean is the below code is unnecessary and repetitive
config.Pattern{Prefix: "someregistry.org"}
when I can do this
config.Pattern{"^someregistry.org"}

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.

3 participants