-
Notifications
You must be signed in to change notification settings - Fork 252
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/helm values wbc #748
Fix/helm values wbc #748
Conversation
support Signed-off-by: David Vidal Villamide <david@askharilabs.com>
fix: search the YAML key with dots first, then navigate the YAML hierarchy in helm values. Signed-off-by: David Vidal Villamide <david@askharilabs.com>
Signed-off-by: David Vidal Villamide <david@askharilabs.com>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #748 +/- ##
==========================================
+ Coverage 55.71% 56.20% +0.48%
==========================================
Files 31 31
Lines 3060 3094 +34
==========================================
+ Hits 1705 1739 +34
Misses 1218 1218
Partials 137 137 ☔ View full report in Codecov by Sentry. |
Signed-off-by: David Vidal Villamide <david@askharilabs.com>
Signed-off-by: David Vidal Villamide <david@askharilabs.com>
Signed-off-by: David Vidal Villamide <david@askharilabs.com>
pkg/argocd/update.go
Outdated
// If we're at the final key, set the value | ||
current[j].Value = value | ||
found = true | ||
break |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we just return here since we've set the value and nothing else needs to be done?
Signed-off-by: David Vidal Villamide <david@askharilabs.com>
I tested locally with a similar configuration and it worked like a charm! Thanks for working on this. |
Thanks @askhari for the fix, and thanks @alexismaior for verifying it! |
Thanks for this fix. We've just run into the issue, is there an expected ETA for a new release of image updater or an image we can use in the mean time? |
I am going to create release on Monday |
Appreciate it! |
Signed-off-by: David Vidal Villamide <david@askharilabs.com>
This PR relates to the previous PRs, issues and comments:
These changes solve the following issues:
To preserve retrocompatibility in case someone already use dots in the YAML keys, we first look for the complete key with dots. Then, if it's not found we go through the YAML hierarchy to find the key.
For example, using an annotation like this: argocd-image-updater.argoproj.io/labcat.helm.image-tag: rollout.image.tag; first we'll try to find a key named "rollout.image.tag" in the YAML root node. And if we do not find it, then it will search the YAML hierarchy searching the following structure:
There are new tests for these code.
Please, comments or suggestions are more than welcome.
Cheers!