Comply with container image tag for manual release
The automated release process complies with container image tag filters
that only release images that match that tag pattern.
This commit extends the manual release to comply with image tag filters
as well.
@@ -231,7 +231,12 @@ func (s ReleaseSpec) calculateImageUpdates(rc ReleaseContext, candidates []*Cont
for _, container := range containers {
currentImageID := container.Image
- filteredImages := imageRepos.GetRepoImages(currentImageID.Name).FilterAndSort(policy.PatternAll)
+ tagPattern := policy.PatternAll
+ if pattern, ok := u.Resource.Policy().Get(policy.TagPrefix(container.Name)); ok {
+ tagPattern = policy.NewPattern(pattern)
+ }
+
+ filteredImages := imageRepos.GetRepoImages(currentImageID.Name).FilterAndSort(tagPattern)
latestImage, ok := filteredImages.Latest()
if !ok {
if currentImageID.CanonicalName() != singleRepo {
