You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+12Lines changed: 12 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -127,6 +127,18 @@ Examples of filters
127
127
| Untag all tags that are older than the duration in app repository | --filter `"app:.*"`|
128
128
| Untag all tags that are older than the duration in all repositories | --filter `".*:.*"`|
129
129
130
+
##### Exclude filter tag
131
+
132
+
To exclude tags from the purging, use the --exclude-filter parameter. Exclude filters take precedence over filters.
133
+
134
+
```sh
135
+
acr purge \
136
+
--registry <Registry Name> \
137
+
--filter <Repository Name>:<Regex filter> \
138
+
--exclude-filter <Regex exclude>
139
+
...
140
+
```
141
+
130
142
#### Ago flag
131
143
132
144
The ago flag can be used to change the default expiration time of a tag, for example, the following command would purge all tags that are older than 30 days:
cmd.Flags().StringVar(&purgeParams.ago, "ago", "", "The tags that were last updated before this duration will be deleted, the format is [number]d[string] where the first number represents an amount of days and the string is in a Go duration format (e.g. 2d3h6m selects images older than 2 days, 3 hours and 6 minutes)")
166
170
cmd.Flags().IntVar(&purgeParams.keep, "keep", 0, "Number of latest to-be-deleted tags to keep, use this when you want to keep at least x number of latest tags that could be deleted meeting all other filter criteria")
167
171
cmd.Flags().StringArrayVarP(&purgeParams.filters, "filter", "f", nil, "Specify the repository and a regular expression filter for the tag name, if a tag matches the filter and is older than the duration specified in ago it will be deleted. Note: If backtracking is used in the regexp it's possible for the expression to run into an infinite loop. The default timeout is set to 1 minute for evaluation of any filter expression. Use the '--filter-timeout-seconds' option to set a different value.")
172
+
cmd.Flags().StringVar(&purgeParams.excludeFilter, "exclude-filter", "", "Specify a regular expression filter for the tag name (without repository!) to be excluded from purge.")
cmd.Flags().Int64Var(&purgeParams.filterTimeout, "filter-timeout-seconds", defaultRegexpMatchTimeoutSeconds, "This limits the evaluation of the regex filter, and will return a timeout error if this duration is exceeded during a single evaluation. If written incorrectly a regexp filter with backtracking can result in an infinite loop.")
0 commit comments