Skip to content

Conversation

@renatovassao
Copy link
Contributor

Summary

Adding support for HelmChart as an ArtifactGenerator source.

Fixes #260.

Changes

  • Updates ArtifactGenerator API to accept HelmChart as source.
  • Updates ArtifactGenerator Controller to handle HelmChart source.

Testing

  1. Deploying controller in brand new kind cluster:
kind create cluster
make dev-deploy
make docker-build
kind load docker-image fluxcd/source-watcher:latest
  1. Create HelmRepository and HelmChart
---
apiVersion: source.toolkit.fluxcd.io/v1
kind: HelmRepository
metadata:
  name: podinfo
  namespace: default
spec:
  interval: 5m0s
  url: https://stefanprodan.github.io/podinfo
---
apiVersion: source.toolkit.fluxcd.io/v1
kind: HelmChart
metadata:
  name: podinfo
  namespace: default
spec:
  interval: 5m0s
  chart: podinfo
  reconcileStrategy: ChartVersion
  sourceRef:
    kind: HelmRepository
    name: podinfo
  version: '5.*'
  1. Create ArtifactGenerator
apiVersion: source.extensions.fluxcd.io/v1beta1
kind: ArtifactGenerator
metadata:
  name: my-app
spec:
  sources:
    - alias: podinfo
      kind: HelmChart
      name: podinfo
  artifacts:
    - name: my-app-composite
      copy:
        - from: "@podinfo/**"
          to: "@artifact/my-app/"
  1. Check generated ExternalArtifact
❯ kubectl get externalartifacts my-app-composite -o yaml

apiVersion: source.toolkit.fluxcd.io/v1
kind: ExternalArtifact
metadata:
  creationTimestamp: "2025-11-29T12:00:43Z"
  generation: 1
  labels:
    app.kubernetes.io/managed-by: source-watcher
    source.extensions.fluxcd.io/generator: 45603312-b6bc-4095-a22e-d08c42b58cea
  name: my-app-composite
  namespace: default
  resourceVersion: "1106"
  uid: d82c4094-5524-4c78-8035-b5a5deea0588
spec:
  sourceRef:
    apiVersion: source.extensions.fluxcd.io/v1beta1
    kind: ArtifactGenerator
    name: my-app
    namespace: default
status:
  artifact:
    digest: sha256:791a3ec5f79510ef0e6571d7d904def86fe34d1faa98b1dbdd42cede94a07080
    lastUpdateTime: "2025-11-29T12:00:43Z"
    path: externalartifact/default/my-app-composite/2669370748.tar.gz
    revision: latest@sha256:791a3ec5f79510ef0e6571d7d904def86fe34d1faa98b1dbdd42cede94a07080
    size: 12556
    url: http://source-watcher.source-system.svc.cluster.local./externalartifact/default/my-app-composite/2669370748.tar.gz
  conditions:
  - lastTransitionTime: "2025-11-29T12:00:43Z"
    message: Artifact is ready
    observedGeneration: 1
    reason: Succeeded
    status: "True"
    type: Ready
  1. Inspect generated artifact
kubectl port-forward -n source-system svc/source-watcher 8000:http
wget localhost:8000/externalartifact/default/my-app-composite/2669370748.tar.gz
tar tvf 2669370748.tar.gz | head
drwxr-x---  0 0      0           0 31 Dez  1969 .
drwxr-x---  0 0      0           0 31 Dez  1969 my-app
drwxr-x---  0 0      0           0 31 Dez  1969 my-app/podinfo
-rw-------  0 0      0         333 31 Dez  1969 my-app/podinfo/.helmignore
-rw-------  0 0      0         287 31 Dez  1969 my-app/podinfo/Chart.yaml
-rw-------  0 0      0       11365 31 Dez  1969 my-app/podinfo/LICENSE
-rw-------  0 0      0        5330 31 Dez  1969 my-app/podinfo/README.md
drwxr-x---  0 0      0           0 31 Dez  1969 my-app/podinfo/templates
-rw-------  0 0      0        1324 31 Dez  1969 my-app/podinfo/templates/NOTES.txt
-rw-------  0 0      0        1965 31 Dez  1969 my-app/podinfo/templates/_helpers.tpl

@stefanprodan stefanprodan added area/api API related issues and pull requests area/generator Artifact generation related issues and pull requests labels Dec 11, 2025
Copy link
Member

@stefanprodan stefanprodan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Thanks @renatovassao 🏅

@stefanprodan stefanprodan merged commit 2512976 into fluxcd:main Dec 15, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/api API related issues and pull requests area/generator Artifact generation related issues and pull requests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow HelmChart as a source in ArtifactGenerator

3 participants