-
Notifications
You must be signed in to change notification settings - Fork 6.5k
feat(hydrator): add inline parameter support to Source Hydrator (#24228) #24277
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
base: master
Are you sure you want to change the base?
feat(hydrator): add inline parameter support to Source Hydrator (#24228) #24277
Conversation
❌ Preview Environment undeployed from BunnyshellAvailable commands (reply to this comment):
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #24277 +/- ##
==========================================
+ Coverage 60.48% 60.57% +0.09%
==========================================
Files 350 350
Lines 60208 60212 +4
==========================================
+ Hits 36417 36474 +57
+ Misses 20853 20812 -41
+ Partials 2938 2926 -12 ☔ View full report in Codecov by Sentry. |
|
Thanks for the PR! I've marked it as draft while it's being iterated over. I think we should add I don't think we can save CRD updates, tests, and docs for a follow-up PR. Those need to be part of the initial PR. |
4e7e061 to
7fad451
Compare
ba3b1ae to
14814e9
Compare
crenshaw-dev
left a comment
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.
Thanks for the changes! Can you add docs and e2e tests?
5ccd11a to
13c9fc0
Compare
be374c9 to
0c9f611
Compare
|
@crenshaw-dev, |
ae5347f to
83a155c
Compare
Signed-off-by: sangyeong01 <[email protected]>
Signed-off-by: sangyeong01 <[email protected]>
Signed-off-by: sangyeong01 <[email protected]>
Signed-off-by: sangyeong01 <[email protected]>
… plugin Signed-off-by: sangyeong01 <[email protected]>
Signed-off-by: sangyeong01 <[email protected]>
Signed-off-by: sangyeong01 <[email protected]>
Signed-off-by: sangyeong01 <[email protected]>
Signed-off-by: sangyeong01 <[email protected]>
Signed-off-by: sangyeong01 <[email protected]>
Signed-off-by: sangyeong01 <[email protected]>
Signed-off-by: sangyeong01 <[email protected]>
83a155c to
26498c9
Compare
|
Hi @crenshaw-dev, Thanks for the follow-up. I've updated the PR to address the additional changes you requested. Please let me know what you think when you have a moment. Thanks! |
| spec: | ||
| version: v1.0 | ||
| generate: | ||
| command: [sh, -c, 'echo "{\"kind\": \"ConfigMap\", \"apiVersion\": \"v1\", \"metadata\": { \"name\": \"plugin-generated-map\", \"namespace\": \"$ARGOCD_APP_NAMESPACE\" }, \"data\": { \"message\": \"plugin-hydrated\", \"source\": \"hydrator-plugin\", \"content\": \"$(cat data.txt)\" }}"'] |
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.
nit: Can be rewritten for increased readability:
generate:
command:
- sh
- -c
- |
cat <<'EOF'
{
"kind": "ConfigMap",
"apiVersion": "v1",
"metadata": {
"name": "plugin-generated-map",
"namespace": "$ARGOCD_APP_NAMESPACE"
},
"data": {
"message": "plugin-hydrated",
"source": "hydrator-plugin",
"content": "$(cat data.txt)"
}
}
EOF
Summary
Add Helm support to Source Hydrator (alpha feature) to enable using Helm charts with environment-specific value files and parameters.
Currently, Source Hydrator only supports basic Git repository fields (
repoURL,targetRevision,path) in theDrySourcespecification, making it impossible to use with Helm charts that requirevalueFiles,parameters, or other Helm-specific configurations.This PR adds a
Helmfield to theDrySourcetype and updates the hydrator logic to properly handle Helm configurations, enabling teams to use Source Hydrator with Helm-based applications.Closes #24228
Changes
Helm *ApplicationSourceHelmfield toDrySourcetype inpkg/apis/application/v1alpha1/types.gocontroller/hydrator/hydrator.goto copy Helm configuration fromDrySourceto the hydratedApplicationSourceExample Usage
Before (not supported):
After (now supported):
Use Case
Many teams use Helm with environment-specific value files (e.g.,
values-dev.yaml,values-prod.yaml). Without this support, Source Hydrator cannot be used for Helm applications, limiting its adoption for teams that want to use both Helm and the hydration workflow.Testing
omitemptytag ensures backward compatibilityFuture Work
Checklist
Notes
This PR focuses on the core API and logic changes. Follow-up PRs will include:
The changes are minimal and backward-compatible, using the
omitemptyJSON tag to ensure existingDrySourceconfigurations continue to work without modification.