Skip to content

Conversation

@sangyeong01
Copy link

@sangyeong01 sangyeong01 commented Aug 26, 2025

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 the DrySource specification, making it impossible to use with Helm charts that require valueFiles, parameters, or other Helm-specific configurations.

This PR adds a Helm field to the DrySource type and updates the hydrator logic to properly handle Helm configurations, enabling teams to use Source Hydrator with Helm-based applications.

Closes #24228

Changes

  • API: Added Helm *ApplicationSourceHelm field to DrySource type in pkg/apis/application/v1alpha1/types.go
  • Logic: Updated controller/hydrator/hydrator.go to copy Helm configuration from DrySource to the hydrated ApplicationSource

Example Usage

Before (not supported):

apiVersion: argoproj.io/v1alpha1
kind: Application
spec:
  sourceHydrator:
    drySource:
      repoURL: https://github.com/example/charts.git
      targetRevision: main
      path: my-chart
      # ❌ helm field not supported

After (now supported):

apiVersion: argoproj.io/v1alpha1
kind: Application
spec:
  sourceHydrator:
    drySource:
      repoURL: https://github.com/example/charts.git
      targetRevision: main
      path: my-chart
      helm:  # ✅ Now works
        valueFiles:
          - values-prod.yaml
        parameters:
          - name: image.tag
            value: v1.2.3
        releaseName: my-release

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

  • Manual testing with Helm chart and multiple value files
  • Verified existing functionality remains unaffected
  • Confirmed omitempty tag ensures backward compatibility

Future Work

  • Add unit tests (will be included in follow-up PR)
  • Update CRD schema (will be included in follow-up PR)
  • Add documentation (will be included in follow-up PR)

Checklist

Notes

This PR focuses on the core API and logic changes. Follow-up PRs will include:

  1. Unit and integration tests
  2. CRD schema updates
  3. Documentation updates
  4. CLI/UI updates if needed

The changes are minimal and backward-compatible, using the omitempty JSON tag to ensure existing DrySource configurations continue to work without modification.

@sangyeong01 sangyeong01 requested a review from a team as a code owner August 26, 2025 16:18
@bunnyshell
Copy link

bunnyshell bot commented Aug 26, 2025

❌ Preview Environment undeployed from Bunnyshell

Available commands (reply to this comment):

  • 🚀 /bns:deploy to deploy the environment

@codecov
Copy link

codecov bot commented Aug 26, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 60.57%. Comparing base (d59276a) to head (26498c9).

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.
📢 Have feedback on the report? Share it here.

@crenshaw-dev crenshaw-dev marked this pull request as draft August 26, 2025 19:20
@crenshaw-dev
Copy link
Member

Thanks for the PR! I've marked it as draft while it's being iterated over.

I think we should add kustomize and directory fields at the same time for feature parity with the source field.

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.

@sangyeong01 sangyeong01 force-pushed the feat/hydrator-helm-support branch 2 times, most recently from 4e7e061 to 7fad451 Compare September 2, 2025 15:49
@sangyeong01 sangyeong01 force-pushed the feat/hydrator-helm-support branch 3 times, most recently from ba3b1ae to 14814e9 Compare September 7, 2025 08:24
Copy link
Member

@crenshaw-dev crenshaw-dev left a 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?

@sangyeong01 sangyeong01 force-pushed the feat/hydrator-helm-support branch 5 times, most recently from 5ccd11a to 13c9fc0 Compare September 13, 2025 13:54
@crenshaw-dev crenshaw-dev changed the title feat(hydrator): add Helm support to Source Hydrator (#24228) feat(hydrator): add inline parameter support to Source Hydrator (#24228) Sep 14, 2025
@sangyeong01 sangyeong01 force-pushed the feat/hydrator-helm-support branch 7 times, most recently from be374c9 to 0c9f611 Compare September 16, 2025 00:58
@sangyeong01 sangyeong01 marked this pull request as ready for review September 16, 2025 08:36
@sangyeong01 sangyeong01 requested a review from a team as a code owner September 16, 2025 08:36
@sangyeong01
Copy link
Author

sangyeong01 commented Sep 20, 2025

@crenshaw-dev,
I’ve addressed all requested changes, including adding docs and e2e tests. Could you please take another look when you have a chance? Thanks!

@sangyeong01 sangyeong01 force-pushed the feat/hydrator-helm-support branch 3 times, most recently from ae5347f to 83a155c Compare September 22, 2025 06:12
@sangyeong01 sangyeong01 force-pushed the feat/hydrator-helm-support branch from 83a155c to 26498c9 Compare September 24, 2025 01:42
@sangyeong01
Copy link
Author

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!

@crenshaw-dev crenshaw-dev added this to the v3.3 milestone Oct 2, 2025
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)\" }}"']
Copy link
Contributor

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

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.

Support Helm valueFiles in Source Hydrator

3 participants