Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
1 task done
nralbers opened this issue Oct 30, 2024 · 1 comment
Open
1 task done

Comments

@nralbers
Copy link

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

  • I agree to follow this project's Code of Conduct
@stefanprodan
Copy link
Member

The chartRef is only supposed in v2

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

No branches or pull requests

2 participants