flux2 icon indicating copy to clipboard operation
flux2 copied to clipboard

`flux create helmrelease`: Clarify that `--chart` cannot be used with OCIRepository

Open marians opened this issue 1 month ago • 0 comments

When combining --chart-ref=OCIRepository with the --chart flag, flux create helmrelease creates an invalid resource.

flux create helmrelease my-hr \
    --namespace=my-namespace \
    --chart-ref=OCIRepository/my-oci-repository.my-namespace \
    --chart my-chart \
    --export

Result:

---
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
  name: my-hr
  namespace: my-namespace
spec:
  chart:
    spec:
      chart: my-chart
      reconcileStrategy: ChartVersion
      sourceRef:
        name: ""
  interval: 1m0s

Applying this resource will result in an error message:

✗ HelmRelease.helm.toolkit.fluxcd.io "my-hr" is invalid: [spec.chart.spec.sourceRef.name: Invalid value: "": spec.chart.spec.sourceRef.name in body should be at least 1 chars long, spec.chart.spec.sourceRef.kind: Required value, : Invalid value: "null": some validation rules were not checked because the object was invalid; correct the existing errors to complete validation]

Suggestion

The CLI should fail early with an error message indicating that --chart cannot be used in combination with --chart-ref.

marians avatar Dec 03 '25 10:12 marians