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

helm values.yaml updates do not work with lists #1032

Open
aburan28 opened this issue Feb 4, 2025 · 2 comments
Open

helm values.yaml updates do not work with lists #1032

aburan28 opened this issue Feb 4, 2025 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@aburan28
Copy link
Contributor

aburan28 commented Feb 4, 2025

Describe the bug
when using the image updater in git write back mode the image updater does not update values in the values.yaml file when the image.tag/name have lists.

an example

images:
  - name: blah
    image: quay.io/animage
    tag: v0.0.1

annotations

argocd-image-updater.argoproj.io/image-list: test=quay.io/animage
argocd-image-updater.argoproj.io/test.helm.image-name: images.0.image
argocd-image-updater.argoproj.io/test.helm.image-tag: images.0.tag

ultimately it picks up the image change but instead of updating it in place within the list of images it will add to the bottom of the values.yaml which ultimately does not trigger the image to be updated properly.

images[0]:
  - tag: v1.0.0 

The issue seems to be caused by the setHelmValue function which incorrectly assumes that the structure of the values is a map. https://github.com/argoproj-labs/argocd-image-updater/blob/master/pkg/argocd/update.go#L575

To Reproduce
Steps to reproduce the behavior:
See above.

Expected behavior
A clear and concise description of what you expected to happen.
an update is made to the values.yaml as shown below

images:
  - name: blah
    image: quay.io/animage
    tag: v1.0.0

Additional context
Add any other context about the problem here.

Version
0.15.2

Note feel free to assign this issue to me. I'm happy to open up a pr to fix this

@aburan28 aburan28 added the bug Something isn't working label Feb 4, 2025
@chengfang
Copy link
Collaborator

@aburan28 thanks for reporting the issue. Feel free work on it and PRs are welcome.

@chengfang
Copy link
Collaborator

In application annotation test.helm.image-name: images.0.image, I'm wondering if we should use images[0].image to access the element.

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