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

Update strategy: newest-build not working #697

Open
congvan1 opened this issue Mar 28, 2024 · 2 comments
Open

Update strategy: newest-build not working #697

congvan1 opened this issue Mar 28, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@congvan1
Copy link

Describe the bug
I using argocd image updater latest (sha256:b3622d981368b5dc31e7d85545c3572e4a1c990cbe2403f8bb8053aa70766672). It was working fine with update-strategy: semver (default) but when i change tag to 8 characters of SHA git commit, it not working it not even show logs (it just empty).

To Reproduce
Here is my yaml file:

apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: image-nexus
  namespace: argocd
  annotations: 
      argocd-image-updater.argoproj.io/image-list: image=****/voc/nodeapp
      argocd-image-updater.argoproj.io/write-back-method: git:secret:argocd/git-creds
      argocd-image-updater.argoproj.io/git-branch: main
      argocd-image-updater.argoproj.io/write-back-target: kustomization
      argocd-image-updater.argoproj.io/image.force-update: "true"

      argocd-image-updater.argoproj.io/image.update-strategy: newest-build 
      argocd-image-updater.argoproj.io/image.ignore-tags: latest, master
      argocd-image-updater.argoproj.io/image.allow-tags: regexp:^[0-9a-f]{8}$
spec:
  project: default
  source:
    repoURL: https://gitlab.com/van1122/project-argocd.git 
    targetRevision: HEAD
    path: image-nexus-service/base
  destination: 
    server: https://kubernetes.default.svc
    namespace: test-image-nexus 
  syncPolicy:
    syncOptions:
    - CreateNamespace=true
    automated:
      selfHeal: true
      prune: true

Expected behavior
When code change in git, a workflow will run to build and push image with a tag is first 8 characters and i want argocd image updater monitoring image registry and automation update new tag to file kustomization.yaml

Additional context
I also give credential of image registry for argocd-image-updater

Version
latest (sha256:b3622d981368b5dc31e7d85545c3572e4a1c990cbe2403f8bb8053aa70766672)

Logs
I don't know why but when i use update-strategy: newest-build there not print logs, it completely empty. When update-strategy is semver everything working fine (have logs)

@congvan1 congvan1 added the bug Something isn't working label Mar 28, 2024
@k-weaver
Copy link

k-weaver commented Apr 3, 2024

I did some testing with using the 'newest-build' strategy and noticed in the logs this was not an acceptable strategy. Image updater ended up defaulting to semver. I am using v0.12.2 when I observed the below error.

level=warning msg="Unknown sort option newest-build -- using semver

The documentation is a bit confusing as there are warnings to switch to the new names but they appear to be not ready yet. You might try using latest instead and see if that works for you.

@congvan1
Copy link
Author

congvan1 commented Apr 4, 2024

I did some testing with using the 'newest-build' strategy and noticed in the logs this was not an acceptable strategy. Image updater ended up defaulting to semver. I am using v0.12.2 when I observed the below error.

level=warning msg="Unknown sort option newest-build -- using semver

The documentation is a bit confusing as there are warnings to switch to the new names but they appear to be not ready yet. You might try using latest instead and see if that works for you.

The version v0.12.2 is different from version latest (sha256:b3622d981368b5dc31e7d85545c3572e4a1c990cbe2403f8bb8053aa70766672), but the update-strategy: latest is working fine in your version v0.12.2? I have tried all scenarios but none of them is work :(

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

No branches or pull requests

2 participants