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

Fix updates to multiple images when using helm values file #790

Merged
merged 1 commit into from
Jul 18, 2024

Conversation

ljupchokotev
Copy link
Contributor

When updating multiple images in a Helm values file, ArgoCD would only ever update a single image. This is because the code only takes into account the new helm values from the last image that it processed ignoring the changes for the previous images.

This commit fixes that behavior. The helmNewValues var is moved outside of the for-loop that iterates over the app images. For each image, the tag is updated in the helmNewValues var.

Fixes #786

@codecov-commenter
Copy link

codecov-commenter commented Jul 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 67.97%. Comparing base (9611c99) to head (90eae75).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #790      +/-   ##
==========================================
+ Coverage   67.84%   67.97%   +0.12%     
==========================================
  Files          31       31              
  Lines        3135     3135              
==========================================
+ Hits         2127     2131       +4     
+ Misses        860      856       -4     
  Partials      148      148              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ljupchokotev ljupchokotev force-pushed the fix-multi-image-helm branch 3 times, most recently from fca9928 to 9e7d8b9 Compare July 18, 2024 13:32
When updating multiple images in a Helm values file, ArgoCD would only
ever update a single image. This is because the code only takes into
account the new helm values from the last image that it processed
ignoring the changes for the previous images.

This commit fixes that behavior. The `helmNewValues` var is moved
outside of the for-loop that iterates over the app images. For each
image, the tag is updated in the `helmNewValues` var.

Signed-off-by: Lyupcho Kotev <[email protected]>
@chengfang chengfang merged commit fa7ae4c into argoproj-labs:master Jul 18, 2024
10 checks passed
@chengfang
Copy link
Collaborator

@ljupchokotev thanks!

@ljupchokotev ljupchokotev deleted the fix-multi-image-helm branch July 18, 2024 18:42
sribiere-jellysmack pushed a commit to sribiere-jellysmack/argocd-image-updater that referenced this pull request Aug 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Writing image updates to helm values file doesn't work with multiple images
3 participants