This repository has been archived by the owner on Feb 2, 2021. It is now read-only.
Fixed image exclusion to work with full regular expressions #130
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.
Right now the image exclusion file (
/etc/docker-gc-exclude
) only supports basic regular expressions like so:Syntax involving regular expression symbols like
^
or$
doesn't work. For example:Although in most cases what's supported is "good enough", it's rather confusing to only partially support typical regex operations. The reason it isn't supported seems to be a limitation of how the matching was done (basically
repo:tag imageid
is passed through with either the first or second block of text matching the regex).This PR fixes that so that
repo:tag
is matched on its own followed byimageid
on its own, and the resulting list of matching image IDs are combined.This is backwards compatible and simply extends the functionality.