feat: add all existing tags to exclusion filter
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user