helmify icon indicating copy to clipboard operation
helmify copied to clipboard

Wrong templating in certificate if chart name is the same as namespace name

Open KaiReichart opened this issue 3 years ago • 2 comments

The generated Certificate looks like this:

apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
  name: {{ include "busola-operator.fullname" . }}-serving-cert
  labels:
  {{- include "busola-operator.labels" . | nindent 4 }}
spec:
  dnsNames:
  - '{{ include "{{ .Release.Namespace }}.fullname" . }}-$(SERVICE_NAME).$(SERVICE_NAMESPACE).svc'
  - '{{ include "{{ .Release.Namespace }}.fullname" . }}-$(SERVICE_NAME).$(SERVICE_NAMESPACE).svc.cluster.local'
  issuerRef:
    kind: Issuer
    name: '{{ include "busola-operator.fullname" . }}-selfsigned-issuer'
  secretName: webhook-server-cert

Under spec.dnsNames the template is {{ include "{{ .Release.Namespace }}.fullname" . }} although it should be {{ include "busola-operator.fullname" . }}

I am using helmify version 0.3.7

It works fine when the chart name is different to the namespace name, this only happens when both are the same

KaiReichart avatar Sep 07 '22 07:09 KaiReichart

HI, @KaiReichart , can you please try to upgrade to the latest version? The issue might be fixed in #42

arttor avatar Sep 09 '22 15:09 arttor

Hi @arttor Unfortunately it persists in the latest version

apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
  name: {{ include "busola-operator.fullname" . }}-serving-cert
  labels:
  {{- include "busola-operator.labels" . | nindent 4 }}
spec:
  dnsNames:
  - '{{ include "{{ .Release.Namespace }}.fullname" . }}-$(SERVICE_NAME).$(SERVICE_NAMESPACE).svc'
  - '{{ include "{{ .Release.Namespace }}.fullname" . }}-$(SERVICE_NAME).$(SERVICE_NAMESPACE).svc.{{
    .Values.kubernetesClusterDomain }}'
  issuerRef:
    kind: Issuer
    name: '{{ include "busola-operator.fullname" . }}-selfsigned-issuer'
  secretName: webhook-server-cert

KaiReichart avatar Sep 12 '22 08:09 KaiReichart