feat: support SourceHydrator applications for image updates#1475
feat: support SourceHydrator applications for image updates#1475julianderks wants to merge 3 commits intoargoproj-labs:masterfrom
Conversation
Signed-off-by: Julian Derks <derks_julian@hotmail.com>
WalkthroughAdds SourceHydrator-aware source type detection and ApplicationSource construction, and makes Helm parameter handling nil-safe so Image Updater can perform write-back for Argo CD Applications that use spec.sourceHydrator.drySource; includes unit and e2e tests and a small Helm chart for testing. Changes
Sequence DiagramsequenceDiagram
participant App as Application\n(SourceHydrator)
participant TypeDetect as getApplicationSourceType
participant SrcConstruct as getApplicationSource
participant Marshal as marshalParamsOverride
participant Git as Git Write-Back
App->>TypeDetect: Request source type
TypeDetect->>TypeDetect: Inspect spec.sourceHydrator.drySource\n(determine Helm/Kustomize/Plugin/Directory)
TypeDetect-->>App: Return source type
App->>SrcConstruct: Build ApplicationSource
SrcConstruct->>SrcConstruct: Extract fields from drySource\n(preserve Helm/Kustomize/Plugin/Directory)
SrcConstruct-->>App: Return ApplicationSource
App->>Marshal: Produce override payload
Marshal->>Marshal: If appSource.Helm nil -> use nil-safe helmParams\nor early-return for Helm-targeted write-back
Marshal-->>App: Return marshaled parameters (or empty)
App->>Git: Perform write-back
Git->>Git: Use drySource repoURL/targetRevision/path
Git-->>App: Write-back complete
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. No actionable comments were generated in the recent review. 🎉 🧹 Recent nitpick comments
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1475 +/- ##
==========================================
+ Coverage 71.48% 72.70% +1.22%
==========================================
Files 50 51 +1
Lines 4667 4916 +249
==========================================
+ Hits 3336 3574 +238
- Misses 1133 1140 +7
- Partials 198 202 +4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: Julian Derks <derks_julian@hotmail.com>
|
I added 1-007-source-hydrator-helm_test.go but it fails in CI because The |
|
@julianderks Sorry for asking you an extra work. P.S. argocd-operator in master branch has ArgoCD v3.3.0 |
…ack" This reverts commit 3a87a6d. Signed-off-by: Julian Derks <derks_julian@hotmail.com>
478b80a to
f047cd6
Compare
Summary
Fix image update processing for Argo CD Applications using
spec.sourceHydrator.Fixes #1403
Motivation
Applications using
spec.sourceHydratorwere not processed correctly for image updates. TheDrySourcefields (Helm, Kustomize, etc.) were not being propagated into theApplicationSource, causing image updates to fail.Implementation
getApplicationSource(): return a fullApplicationSourcefrom allDrySourcefields (RepoURL, Path, TargetRevision, Helm, Kustomize, Directory, Plugin) for SourceHydrator appsgetApplicationSourceType(): detect source type fromDrySourceHelm/Kustomize/Plugin fields instead of relying onStatus.SourceTypemarshalParamsOverride(): handle nilHelmfield safely so the custom values file write-back path does not silently return emptyTests
make lintandmake testpassSummary by CodeRabbit
New Features
Bug Fixes
Tests