crossplane-contrib/provider-helm

Keep metadata.name field

braghettos opened this issue · 3 comments

What happened?

I would like the release of the helm chart to have a precise name but I'm not able to define it in metadata.name because it is overridden. The only way to decide the helm release name is to patch it but still is not the solution I'm looking for.

How can we reproduce it?

Try to use this manifest in a composition:

    - base:
        apiVersion: helm.crossplane.io/v1beta1
        kind: Release
        metadata:
          name: argo-cd
        spec:
          forProvider:
            chart:
              name: argo-cd
              repository: https://argoproj.github.io/argo-helm
              version: 3.26.5
            namespace: argo-system

What environment did it happen in?

  • Crossplane version: 1.7.0
  • Kubernetes version (use kubectl version) 1.21
  • Kubernetes distribution (e.g. Tectonic, GKE, OpenShift): EKS

Did you try setting the metadata.annotations["crossplane.io/external-name"] in the Release object to the name that you want the helm release to have? That's the "official" way of setting the name of the thing that is being created.

https://crossplane.io/docs/v1.7/reference/composition.html#influencing-external-names

@bobh66 it's not working for this provider:

    - base:
        apiVersion: helm.crossplane.io/v1beta1
        kind: Release
        metadata:
          annotations:
            crossplane.io/external-name: app
        spec:
          forProvider:
            chart:
              name: argo-cd
              repository: https://argoproj.github.io/argo-helm
              version: 3.26.5
            namespace: argo-system

Still being ignored:

kubectl get releases                        
NAME                           CHART   VERSION   SYNCED   READY   STATE   REVISION   DESCRIPTION   AGE
test-vdvvg   app     0.1.12    False                                             47m

By bad, actually the name of the release is 'app' now!