Uploaded image for project: 'Debezium'
  1. Debezium
  2. DBZ-8447

HELM chart has incorrect templating when watchNamespaces is set to specific namespace(s)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 3.0.4.Final
    • 3.0.2.Final
    • debezium-operator
    • None

      helm install debezium-operator debezium/debezium-operator --version 3.0.0-final  --set watchNamespaces=debezium -n debezium     ⎈ kind-kind-cluster 11:55:02
      Error: INSTALLATION FAILED: template: debezium-operator/templates/debeziumserver-crd-role-binding.yaml:44:37: executing "debezium-operator/templates/debeziumserver-crd-role-binding.yaml" at <.Chart.Name>: can't evaluate field Chart in type strin
      

      This is cause by incorrect use of `.` variable in range loop

      {{ range $anamespace := ( split "," $.Values.watchNamespaces ) }}
      apiVersion: rbac.authorization.k8s.io/v1
      kind: RoleBinding
      metadata:
        name: debeziumserver-role-binding
        namespace: {{ $anamespace }}
        labels:
          app.kubernetes.io/name: {{ .Chart.Name }}
          app.kubernetes.io/version: {{ .Chart.AppVersion }}
          app.kubernetes.io/managed-by: quarkus
      roleRef:
        kind: ClusterRole
        apiGroup: rbac.authorization.k8s.io
        name: debeziumserver-cluster-role
      subjects:
        - kind: ServiceAccount
          name: {{ $.Chart.Name }}
          namespace: {{ $.Release.Namespace }}
      ---
      {{- end }}
      

              jcechace@redhat.com Jakub Čecháček
              jcechace@redhat.com Jakub Čecháček
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: