Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Same image is updated multiple times, 1.20 --> 1.20.0 --> 1.20 --> 1.20.0 #375

Closed
HetrTiXc opened this issue Feb 8, 2022 · 5 comments · Fixed by #559
Closed

Same image is updated multiple times, 1.20 --> 1.20.0 --> 1.20 --> 1.20.0 #375

HetrTiXc opened this issue Feb 8, 2022 · 5 comments · Fixed by #559
Labels
bug Something isn't working

Comments

@HetrTiXc
Copy link

HetrTiXc commented Feb 8, 2022

Seems like the image updater is stuck in a loop of updating the same image back and forth between the same version, 1.20 --> 1.20.0 --> 1.20 --> 1.20.0 etc

I have only seen it happen with this one image this far, and I have multiple other images that are tagged the same way. Image mask is :v1.x

ArgoCD Image updater: v0.11.3
ArgoCD: v2.2.4
Registry: Azure container registry

time="2022-02-08T08:46:25Z" level=info msg="Starting image update cycle, considering 1 annotated application(s) for update"
time="2022-02-08T08:46:25Z" level=info msg="Setting new image to my-registry/my-image:v1.20" alias=my-alias application=integration-test image_name=my-image image_tag=v1.20.0 registry=my-registry
time="2022-02-08T08:46:25Z" level=info msg="Successfully updated image 'my-registry/my-image:v1.20.0' to 'my-registry/my-image:v1.20', but pending spec update (dry run=false)" alias=my-alias application=integration-test image_name=my-image image_tag=v1.20.0 registry=my-registry
time="2022-02-08T08:46:26Z" level=info msg="Committing 1 parameter update(s) for application integration-test" application=integration-test
time="2022-02-08T08:46:26Z" level=info msg="Successfully updated the live application spec" application=integration-test
time="2022-02-08T08:46:26Z" level=info msg="Processing results: applications=1 images_considered=6 images_skipped=1 images_updated=1 errors=0"
time="2022-02-08T08:48:26Z" level=info msg="Starting image update cycle, considering 1 annotated application(s) for update"
time="2022-02-08T08:48:26Z" level=info msg="Setting new image to my-registry/my-image:v1.20.0" alias=my-alias application=integration-test image_name=my-image image_tag=v1.20 registry=my-registry
time="2022-02-08T08:48:26Z" level=info msg="Successfully updated image 'my-registry/my-image:v1.20' to 'my-registry/my-image:v1.20.0', but pending spec update (dry run=false)" alias=my-alias application=integration-test image_name=my-image image_tag=v1.20 registry=my-registry
time="2022-02-08T08:48:27Z" level=info msg="Committing 1 parameter update(s) for application integration-test" application=integration-test
time="2022-02-08T08:48:27Z" level=info msg="Successfully updated the live application spec" application=integration-test
time="2022-02-08T08:48:27Z" level=info msg="Processing results: applications=1 images_considered=6 images_skipped=1 images_updated=1 errors=0"
time="2022-02-08T08:50:27Z" level=info msg="Starting image update cycle, considering 1 annotated application(s) for update"
time="2022-02-08T08:50:28Z" level=info msg="Processing results: applications=1 images_considered=6 images_skipped=1 images_updated=0 errors=0"
time="2022-02-08T08:52:28Z" level=info msg="Starting image update cycle, considering 1 annotated application(s) for update"
time="2022-02-08T08:52:30Z" level=info msg="Processing results: applications=1 images_considered=6 images_skipped=1 images_updated=0 errors=0"
time="2022-02-08T08:54:30Z" level=info msg="Starting image update cycle, considering 1 annotated application(s) for update"
time="2022-02-08T08:54:31Z" level=info msg="Processing results: applications=1 images_considered=6 images_skipped=1 images_updated=0 errors=0"
time="2022-02-08T08:56:31Z" level=info msg="Starting image update cycle, considering 1 annotated application(s) for update"
time="2022-02-08T08:56:32Z" level=info msg="Setting new image to my-registry/my-image:v1.20" alias=my-alias application=integration-test image_name=my-image image_tag=v1.20.0 registry=my-registry
time="2022-02-08T08:56:32Z" level=info msg="Successfully updated image 'my-registry/my-image:v1.20.0' to 'my-registry/my-image:v1.20', but pending spec update (dry run=false)" alias=my-alias application=integration-test image_name=my-image image_tag=v1.20.0 registry=my-registry
time="2022-02-08T08:56:32Z" level=info msg="Committing 1 parameter update(s) for application integration-test" application=integration-test
time="2022-02-08T08:56:32Z" level=info msg="Successfully updated the live application spec" application=integration-test
time="2022-02-08T08:56:32Z" level=info msg="Processing results: applications=1 images_considered=6 images_skipped=1 images_updated=1 errors=0"
time="2022-02-08T08:58:32Z" level=info msg="Starting image update cycle, considering 1 annotated application(s) for update"
time="2022-02-08T08:58:33Z" level=info msg="Processing results: applications=1 images_considered=6 images_skipped=1 images_updated=0 errors=0"
time="2022-02-08T09:00:34Z" level=info msg="Starting image update cycle, considering 1 annotated application(s) for update"
time="2022-02-08T09:00:34Z" level=info msg="Setting new image to my-registry/my-image:v1.20.0" alias=my-alias application=integration-test image_name=my-image image_tag=v1.20 registry=my-registry
time="2022-02-08T09:00:34Z" level=info msg="Successfully updated image 'my-registry/my-image:v1.20' to 'my-registry/my-image:v1.20.0', but pending spec update (dry run=false)" alias=my-alias application=integration-test image_name=my-image image_tag=v1.20 registry=my-registry
time="2022-02-08T09:00:35Z" level=info msg="Committing 1 parameter update(s) for application integration-test" application=integration-test
time="2022-02-08T09:00:35Z" level=info msg="Successfully updated the live application spec" application=integration-test
time="2022-02-08T09:00:35Z" level=info msg="Processing results: applications=1 images_considered=6 images_skipped=1 images_updated=1 errors=0"
time="2022-02-08T09:02:35Z" level=info msg="Starting image update cycle, considering 1 annotated application(s) for update"
time="2022-02-08T09:02:36Z" level=info msg="Processing results: applications=1 images_considered=6 images_skipped=1 images_updated=0 errors=0"
time="2022-02-08T09:04:37Z" level=info msg="Starting image update cycle, considering 1 annotated application(s) for update"
time="2022-02-08T09:04:37Z" level=info msg="Setting new image to my-registry/my-image:v1.20" alias=my-alias application=integration-test image_name=my-image image_tag=v1.20.0 registry=my-registry
time="2022-02-08T09:04:37Z" level=info msg="Successfully updated image 'my-registry/my-image:v1.20.0' to 'my-registry/my-image:v1.20', but pending spec update (dry run=false)" alias=my-alias application=integration-test image_name=my-image image_tag=v1.20.0 registry=my-registry
time="2022-02-08T09:04:38Z" level=info msg="Committing 1 parameter update(s) for application integration-test" application=integration-test
time="2022-02-08T09:04:38Z" level=info msg="Successfully updated the live application spec" application=integration-test
time="2022-02-08T09:04:38Z" level=info msg="Processing results: applications=1 images_considered=6 images_skipped=1 images_updated=1 errors=0"
time="2022-02-08T09:06:38Z" level=info msg="Starting image update cycle, considering 1 annotated application(s) for update"
time="2022-02-08T09:06:39Z" level=info msg="Setting new image to my-registry/my-image:v1.20.0" alias=my-alias application=integration-test image_name=my-image image_tag=v1.20 registry=my-registry
time="2022-02-08T09:06:39Z" level=info msg="Successfully updated image 'my-registry/my-image:v1.20' to 'my-registry/my-image:v1.20.0', but pending spec update (dry run=false)" alias=my-alias application=integration-test image_name=my-image image_tag=v1.20 registry=my-registry
time="2022-02-08T09:06:39Z" level=info msg="Committing 1 parameter update(s) for application integration-test" application=integration-test
time="2022-02-08T09:06:39Z" level=info msg="Successfully updated the live application spec" application=integration-test
time="2022-02-08T09:06:39Z" level=info msg="Processing results: applications=1 images_considered=6 images_skipped=1 images_updated=1 errors=0"
time="2022-02-08T09:08:40Z" level=info msg="Starting image update cycle, considering 1 annotated application(s) for update"
time="2022-02-08T09:08:41Z" level=info msg="Processing results: applications=1 images_considered=6 images_skipped=1 images_updated=0 errors=0"

@jannfis
Copy link
Contributor

jannfis commented Feb 12, 2022

From a semver perspective, 1.20.0 and 1.20 are the same versions, but I agree, the result for such situations should be stable and predictable.

As a workaround, you probably want an additional allow-tags restriction to allow only tags matching x.y.z, e.g. <youralias>.allow-tags: regexp:^[v]?[0-9]+\.[0-9]+\.[0-9]+$

@jannfis jannfis added the bug Something isn't working label Feb 12, 2022
@HetrTiXc
Copy link
Author

Thanks, it works fine using the workaround!

It seems to be an intermittent issue as it at one point stopped updating back and forth some days back (I was not at work so no one touched the system explicitly). But logs still said the following every 2-6th iteration:

time="2022-02-10T06:34:22Z" level=info msg="Successfully updated image 'my-registry/my-image:v1.20' to 'my-registry/my-image:v1.20.0', but pending spec update (dry run=false)" alias=my-alias application=integration-test image_name=my-image image_tag=v1.20 registry=my-registry

Dug a bit more and found the previous replica which didn't have any pods, but ArgoCD still insisted it had a pod in processing state. After deleting the rs it quited down and with the workaround everything looks normal.

@l3system
Copy link

I get this behaviour from the Docker hub image "sensu/sensu" (monitoring)
ArgoCD keeps replacing 6.8 with 6.8.0 and back.

https://hub.docker.com/r/sensu/sensu/tags?page=1&name=6.8.

@jsirianni
Copy link

I am seeing this exact behavior. We tag with major, major.minor, and major.minor.patch with every release. I am watching argocd loop between 1.4 and 1.4.0 over and over.

@simbelmas
Copy link

Don't know if it's related of if i have to open another issue, but when trying to update images like docker.io/traefik:~2 there is a loop between the numeric tag and the 'v' prefixed tag.

time="2023-01-17T19:07:13Z" level=info msg="Successfully updated image 'docker.io/traefik:2.9.6' to 'docker.io/traefik:v2.9.6', but pending spec update (dry run=false)" alias= application=traefik image_name=traefik image_tag=2.9.6 registry=docker.io
...
time="2023-01-17T19:24:07Z" level=info msg="Successfully updated image 'docker.io/traefik:v2.9.6' to 'docker.io/traefik:2.9.6', but pending spec update (dry run=false)" alias= application=traefik image_name=traefik image_tag=v2.9.6 registry=docker.io

Argocd application configuration:

metadata:
  name: traefik
  annotations:
    argocd-image-updater.argoproj.io/image-list: docker.io/traefik:~2
    argocd-image-updater.argoproj.io/traefik.update-strategy: semver
    argocd-image-updater.argoproj.io/traefik.platforms: linux/arm,linux/amd64
    argocd-image-updater.argoproj.io/write-back-method: git
    argocd-image-updater.argoproj.io/write-back-target: kustomization
spec:
  project: default
  # Source of the application manifests
  source:
    repoURL: xxx
    targetRevision: master
    path: .
    ...

Argocd v2.5.6+9db2c94
Argocd-image-updater:v0.12.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants