Skip to content

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

@marians

Description

@marians

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/uxIn pursuit of a delightful user experiencegood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions