Skip to content

Commit f282927

Browse files
check if alias exist
Signed-off-by: Pasha Kostohrys <pavel@codefresh.io>
1 parent 4a08ed6 commit f282927

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

pkg/argocd/update.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -419,13 +419,18 @@ func marshalParamsOverride(app *v1alpha1.Application, originalData []byte) ([]by
419419
images := GetImagesAndAliasesFromApplication(app)
420420

421421
for _, c := range images {
422+
423+
if c.ImageAlias == "" {
424+
continue
425+
}
426+
422427
helmAnnotationParamName, helmAnnotationParamVersion := getHelmParamNamesFromAnnotation(app.Annotations, c)
423428

424429
if helmAnnotationParamName == "" {
425-
return nil, fmt.Errorf("could not find an image-name annotation for image %s", c.ImageAlias)
430+
return nil, fmt.Errorf("could not find an image-name annotation for image %s", c.ImageName)
426431
}
427432
if helmAnnotationParamVersion == "" {
428-
return nil, fmt.Errorf("could not find an image-tag annotation for image %s", c.ImageAlias)
433+
return nil, fmt.Errorf("could not find an image-tag annotation for image %s", c.ImageName)
429434
}
430435

431436
helmParamName := getHelmParam(appSource.Helm.Parameters, helmAnnotationParamName)

0 commit comments

Comments
 (0)