From f282927d72f890111297fd75eb64b53409c0223a Mon Sep 17 00:00:00 2001 From: Pasha Kostohrys Date: Wed, 29 May 2024 19:09:35 +0300 Subject: check if alias exist Signed-off-by: Pasha Kostohrys --- pkg/argocd/update.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pkg/argocd/update.go b/pkg/argocd/update.go index 85dee36..0f1cab2 100644 --- a/pkg/argocd/update.go +++ b/pkg/argocd/update.go @@ -419,13 +419,18 @@ func marshalParamsOverride(app *v1alpha1.Application, originalData []byte) ([]by images := GetImagesAndAliasesFromApplication(app) for _, c := range images { + + if c.ImageAlias == "" { + continue + } + helmAnnotationParamName, helmAnnotationParamVersion := getHelmParamNamesFromAnnotation(app.Annotations, c) if helmAnnotationParamName == "" { - return nil, fmt.Errorf("could not find an image-name annotation for image %s", c.ImageAlias) + return nil, fmt.Errorf("could not find an image-name annotation for image %s", c.ImageName) } if helmAnnotationParamVersion == "" { - return nil, fmt.Errorf("could not find an image-tag annotation for image %s", c.ImageAlias) + return nil, fmt.Errorf("could not find an image-tag annotation for image %s", c.ImageName) } helmParamName := getHelmParam(appSource.Helm.Parameters, helmAnnotationParamName) -- cgit v1.2.3