flux2 icon indicating copy to clipboard operation
flux2 copied to clipboard

published crd schema helmrelease-helm-v2beta1.json incorrectly shows spec/chart as required

Open nralbers opened this issue 1 year ago • 1 comments

Describe the bug

The published standalone schema for helmrelease-helm-v2beta1.json will flag a release using a chartRef instead of a chart as invalid.

Steps to reproduce

  1. Create Helmrelease using OCI repository as a chartref
  2. Run https://github.com/fluxcd/flux2-kustomize-helm-example/blob/main/scripts/validate.sh on cluster
  3. validation will fail on helmrelease stating that chart is a required property of spec

Example helmrelease

apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
  name: external-dns
  namespace: external-dns
spec:
  chartRef:
    kind: OCIRepository
    name: external-dns
    namespace: flux-system
  interval: 15m
  timeout: 5m
  releaseName: external-dns
  values: 
    ...

Expected behavior

validation json should allow either chart or chartref

So

"spec": {
  ...
   "required": [
            "chart",
            "interval"
          ],
         
} 

becomes

"spec": {
  ...
   "required": [
            "interval"
          ],
          "oneOf": [
              {
                  "required": [
                      "chart"
                  ]
              },
              {
                  "required":[
                      "chartRef"
                  ]
              }
          ],
} 

Screenshots and recordings

No response

OS / Distro

N/A

Flux version

v2.4.0

Flux check

N/A

Git provider

No response

Container Registry provider

No response

Additional context

No response

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

nralbers avatar Oct 30 '24 11:10 nralbers

The chartRef is only supposed in v2

stefanprodan avatar Oct 30 '24 12:10 stefanprodan