Skip to content

Commit

Permalink
use new variable in log
Browse files Browse the repository at this point in the history
Signed-off-by: Álvaro Aguilar-Tablada Espinosa <[email protected]>
  • Loading branch information
aaguilartablada committed Dec 12, 2024
1 parent 78f1b4f commit 1f859d7
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pkg/argocd/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -287,21 +287,21 @@ func UpdateApplication(updateConf *UpdateConfiguration, state *SyncIterationStat

if needsUpdate(updateableImage, applicationImage, latest) {
appImageWithTag := applicationImage.WithTag(latest)
appImageWithTagFull := appImageWithTag.GetFullNameWithTag()
appImageFullNameWithTag := appImageWithTag.GetFullNameWithTag()

// Check if new image is already set in Application Spec when write back is set to argocd
// and compare with new image
appImageSpec, err := getAppImage(&updateConf.UpdateApp.Application, appImageWithTag)
if err != nil {
continue
}
if appImageSpec == appImageWithTagFull {
imgCtx.Infof("New image %s already set in spec", appImageWithTagFull)
if appImageSpec == appImageFullNameWithTag {
imgCtx.Infof("New image %s already set in spec", appImageFullNameWithTag)
continue
}

needUpdate = true
imgCtx.Infof("Setting new image to %s", appImageWithTagFull)
imgCtx.Infof("Setting new image to %s", appImageFullNameWithTag)

err = setAppImage(&updateConf.UpdateApp.Application, appImageWithTag)

Expand All @@ -310,7 +310,7 @@ func UpdateApplication(updateConf *UpdateConfiguration, state *SyncIterationStat
result.NumErrors += 1
continue
} else {
imgCtx.Infof("Successfully updated image '%s' to '%s', but pending spec update (dry run=%v)", updateableImage.GetFullNameWithTag(), appImageWithTag.GetFullNameWithTag(), updateConf.DryRun)
imgCtx.Infof("Successfully updated image '%s' to '%s', but pending spec update (dry run=%v)", updateableImage.GetFullNameWithTag(), appImageFullNameWithTag, updateConf.DryRun)
changeList = append(changeList, ChangeEntry{appImageWithTag, updateableImage.ImageTag, appImageWithTag.ImageTag})
result.NumImagesUpdated += 1
}
Expand Down

0 comments on commit 1f859d7

Please sign in to comment.