argocd-image-updater
argocd-image-updater copied to clipboard
Unsync'd parameter changes are ignored when evaluating whether to patch parameters
Describe the bug If an Application has previously been sync'd to the latest image, ArgoCD Image Updater will never update parameters even if they do not currently match the latest image (and have not been sync'd).
If an application has not been sync'd to the latest image, ArgoCD Image Updater will repeatedly update parameters even if they already match the latest image (and have not been sync'd).
To Reproduce Steps to reproduce the behavior:
- Create an application with image update parameters.
- Allow ArgoCD Image Updater to update the parameters.
- Sync the application.
- Change the tag parameter in ArgoCD.
- ArgoCD Image Updater ignores this change and will never overwrite the parameter again.
Alternately:
- Create an application with image update parameters.
- Allow ArgoCD Image Updater to update the parameters.
- Observe (from logs) that ArgoCD Image Updater updates the parameters with every cycle, even though they are already set to the latest tag.
Expected behavior ArgoCD Image Updater should update parameters if they have different values than expected, and not if they already have the same values as expected.
Additional context n/a
Version
/ $ argocd-image-updater version
argocd-image-updater: v0.12.2+1aa317c
BuildDate: 2023-01-21T18:06:54Z
GitCommit: 1aa317c3c57cdbd3e7f1b7accc99337f112a69e6
GoVersion: go1.18.10
GoCompiler: gc
Platform: linux/amd64
Logs
Example log message (at the time of this running, the image tag parameter was set to 0.1.1
):
time="2023-12-22T14:29:25Z" level=debug msg="Processing application commsflow-server-commsflow"
time="2023-12-22T14:29:25Z" level=debug msg="Considering this image for update" alias=img application=commsflow-server-commsflow image_name=images/prod/python/comms/workflow/server/commsflow_server_img image_tag=0.1131804.341521 registry=buildfactory.hioscar.com
time="2023-12-22T14:29:25Z" level=debug msg="Using version constraint '0.x-0' when looking for a new tag" alias=img application=commsflow-server-commsflow image_name=images/prod/python/comms/workflow/server/commsflow_server_img image_tag=0.1131804.341521 registry=buildfactory.hioscar.com
time="2023-12-22T14:29:26Z" level=debug msg="target parameters: image-spec= image-name=deployment.podtemplate.image, image-tag=deployment.podtemplate.imageVersion" application=commsflow-server-commsflow image=buildfactory.hioscar.com/images/prod/python/comms/workflow/server/commsflow_server_img
time="2023-12-22T14:29:26Z" level=debug msg="Image 'buildfactory.hioscar.com/images/prod/python/comms/workflow/server/commsflow_server_img:0.1131804.341521' already on latest allowed version" alias=img application=commsflow-server-commsflow image_name=images/prod/python/comms/workflow/server/commsflow_server_img image_tag=0.1131804.341521 registry=buildfactory.hioscar.com