fluxcd / helm-controller

The GitOps Toolkit Helm reconciler, for declarative Helming
https://fluxcd.io
Apache License 2.0
408 stars 163 forks source link

HelmRelease does redundant validation on chart name #888

Closed Varun-Mehrotra closed 8 months ago

Varun-Mehrotra commented 8 months ago

Hello,

I'm setting up a workflow with the following components:

  1. Private Dockerhub OCI repository where my Helm Charts are stored
  2. EKS Cluster
  3. Kustomizations stored in a Private Github repo
  4. Flux deploying my customizations to my EKS Cluster

I've setup the following HelmRepository:

apiVersion: source.toolkit.fluxcd.io/v1beta2
kind: HelmRepository
metadata:
  name: my-dockerhub-oci
  namespace: flux-system
spec:
  type: "oci"
  interval: 1m
  url: oci://registry-1.docker.io/my-org
  secretRef:
    name: dockerhub-credentials  

and the following HelmRelease:

apiVersion: helm.toolkit.fluxcd.io/v2beta2
kind: HelmRelease
metadata:
  name: my-application
  namespace: flux-system
spec:
  interval: 1m
  chart:
    spec:
      chart: internal.my-chart
      version: "2024.3.0"
      sourceRef:
        kind: HelmRepository
        name: my-dockerhub-oci
        namespace: flux-system
      interval: 1m
  values:
    key: value

The issue I'm running into is that the internal.my-chart format isn't supported, specifically the . and I'm receiving the following error on my HelmRelease object:

HelmChart ''flux-system/flux-system-my-application'' is not ready: invalid chart reference: invalid chart name ''internal.my-chart'': a valid name must be lower case letters and numbers and MAY be separated with dashes (-)

And when I remove the internal. it works without any issues (but obviously targeting the wrong chart).

Now the reason that I'm submitting this issues is that my chart has already been uploaded to our Dockerhub OCI repo and helm pull works, making the validation that's going on here redundant; if there were an error with the name the OCI repo would've already errored before it even gets pushed in.

I was wondering what the reason for this drift from typical helm functionality and if there really isn't, if it's possible to remove the redundant validation. I'm happy to make those contributions myself 😃

Cheers, Varun

Varun-Mehrotra commented 8 months ago

Nevermind. As I was looking into where the validation is occuring, it seems like it's actually in the fluxcd/source-controller repository. I'll open my issue there.