-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Regular expression filtering #73
Labels
enhancement
New feature or request
Comments
filter:
pattern: 'dev-(.*)'
extract: '\1' where |
+1 on |
relu
added a commit
that referenced
this issue
Jan 11, 2021
Tag regex filtering allows the user to filter tags based on a regular expression pattern and enables tag version extraction through capture group replacement reference. Fixes #73 Signed-off-by: Aurel Canciu <[email protected]>
relu
added a commit
that referenced
this issue
Jan 11, 2021
Tag regex filtering allows the user to filter tags based on a regular expression pattern and enables tag version extraction through capture group replacement reference. Fixes #73 Signed-off-by: Aurel Canciu <[email protected]>
relu
added a commit
that referenced
this issue
Jan 11, 2021
Tag regex filtering allows the user to filter tags based on a regular expression pattern and enables tag version extraction through capture group replacement reference. Fixes #73 Signed-off-by: Aurel Canciu <[email protected]>
relu
added a commit
that referenced
this issue
Jan 13, 2021
Tag regex filtering allows the user to filter tags based on a regular expression pattern and enables tag version extraction through capture group replacement reference. Fixes #73 Signed-off-by: Aurel Canciu <[email protected]>
relu
added a commit
that referenced
this issue
Jan 13, 2021
Tag regex filtering allows the user to filter tags based on a regular expression pattern and enables tag version extraction through capture group replacement reference. Fixes #73 Signed-off-by: Aurel Canciu <[email protected]>
relu
added a commit
that referenced
this issue
Jan 13, 2021
Tag regex filtering allows the user to filter tags based on a regular expression pattern and enables tag version extraction through capture group replacement reference. Fixes #73 Signed-off-by: Aurel Canciu <[email protected]>
relu
added a commit
that referenced
this issue
Jan 13, 2021
Tag regex filtering allows the user to filter tags based on a regular expression pattern and enables tag version extraction through capture group replacement reference. Fixes #73 Signed-off-by: Aurel Canciu <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sometimes people want to partition their container image repo and use only a subset of the images. For example, by giving all the images destined for a dev environment a prefix
dev-
.To give those people a way to filter for the desired subset of images, we can let them supply a regular expression in their
ImagePolicy
spec, and consider only the tags that match the regular expression.They may also want to use only a portion of the tag for sorting, e.g., if the sort order is CalVer but there is a prefix, like
dev-2021-01-11.build-1
. Therefore it's useful to be able to sort using a particular capture group from the regular expression, or more generally, a replacement expression.Why not globbing?
Globs are simpler to understand --
dev-*
-- but suffer from a couple of problems:If we implemented globs, we would very likely be asked to also implement regexp -- this is what happened for Flux v1. In the context of image tags, which don't have path separators (so no
**
glob pattern), it is not difficult to construct a regular expression that's equivalent to a glob:dev-.*
fordev-*
and so on.Place in the API
#58 (comment) and the comment following it #58 (comment) suggest that filtering is independent of the ordering. It can either appear in each policy:
or it can appear alongside the policy:
There's a sense in which the filtering takes place before the policy (e.g., extract the version portion of the tag before checking the semver range), so the latter feels closer to how people might think about it.
The text was updated successfully, but these errors were encountered: