Keep tags based on regex (#61)

* Ignore tags from purging by regexp
This commit is contained in:
Dieter Maes
2022-04-08 16:21:36 +02:00
committed by GitHub
parent 31b16bb17a
commit 76f380d3c2
3 changed files with 12 additions and 4 deletions

View File

@@ -39,6 +39,7 @@ type configData struct {
Debug bool `yaml:"debug"`
PurgeTagsKeepDays int `yaml:"purge_tags_keep_days"`
PurgeTagsKeepCount int `yaml:"purge_tags_keep_count"`
PurgeTagsKeepRegexp string `yaml:"purge_tags_keep_regexp"`
PurgeTagsSchedule string `yaml:"purge_tags_schedule"`
}
@@ -351,5 +352,5 @@ func (a *apiClient) receiveEvents(c echo.Context) error {
// purgeOldTags purges old tags.
func (a *apiClient) purgeOldTags(dryRun bool) {
registry.PurgeOldTags(a.client, dryRun, a.config.PurgeTagsKeepDays, a.config.PurgeTagsKeepCount)
registry.PurgeOldTags(a.client, dryRun, a.config.PurgeTagsKeepDays, a.config.PurgeTagsKeepCount, a.config.PurgeTagsKeepRegexp)
}