feat: add all existing tags to exclusion filter

This commit is contained in:
2022-09-27 10:00:16 +02:00
parent f2c1ccf97d
commit 1ab4f8361b
2 changed files with 64 additions and 1 deletions
+9 -1
View File
@@ -42,7 +42,15 @@ func handle(cli CLI, logger log.Interface, kubeClient *kube.Client, gitlabClient
return err
}
for image, versions := range images {
if err := gitlabClient.UpdateCleanupPolicy(image, versions); err != nil {
tags, err := gitlabClient.GetTags(image)
if err != nil {
return err
}
tagVersions := make([]string, len(tags))
for i, tag := range tags {
tagVersions[i] = tag.Name
}
if err := gitlabClient.UpdateCleanupPolicy(image, append(versions, tagVersions...)); err != nil {
return err
}
}