diff --git a/pkg/argocd/update.go b/pkg/argocd/update.go index 2910d99d..3e4e77df 100644 --- a/pkg/argocd/update.go +++ b/pkg/argocd/update.go @@ -141,6 +141,10 @@ func UpdateApplication(updateConf *UpdateConfiguration, state *SyncIterationStat result := ImageUpdaterResult{} app := updateConf.UpdateApp.Application.GetName() changeList := make([]ChangeEntry, 0) + prefix := updateConf.UpdateApp.Application.ObjectMeta.Annotations[fmt.Sprintf(common.RegistryPrefixAnnotation, app)] + if prefix != "" { + prefix = "/" + prefix + } // Get all images that are deployed with the current application applicationImages := GetImagesFromApplication(&updateConf.UpdateApp.Application) @@ -183,7 +187,7 @@ func UpdateApplication(updateConf *UpdateConfiguration, state *SyncIterationStat imgCtx.Debugf("Considering this image for update") - rep, err := registry.GetRegistryEndpoint(applicationImage.RegistryURL) + rep, err := registry.GetRegistryEndpoint(applicationImage.RegistryURL + prefix) if err != nil { imgCtx.Errorf("Could not get registry endpoint from configuration: %v", err) result.NumErrors += 1 diff --git a/pkg/common/constants.go b/pkg/common/constants.go index 5abf6da6..ef324ef3 100644 --- a/pkg/common/constants.go +++ b/pkg/common/constants.go @@ -35,6 +35,7 @@ const ( UpdateStrategyAnnotation = ImageUpdaterAnnotationPrefix + "/%s.update-strategy" PullSecretAnnotation = ImageUpdaterAnnotationPrefix + "/%s.pull-secret" PlatformsAnnotation = ImageUpdaterAnnotationPrefix + "/%s.platforms" + RegistryPrefixAnnotation = ImageUpdaterAnnotationPrefix + "/%s.registry-prefix" ) // Application-wide update strategy related annotations