emissary-ingress / emissary

open source Kubernetes-native API gateway for microservices built on the Envoy Proxy

Home Page:https://www.getambassador.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cannot override name with nameOverride when the release name is ambassador

dhamkannan opened this issue · comments

Describe the bug

With emissary-ingress helm-charts, we cannot override the name with nameOverride when the release name is ambassador.

With the below mentioned tpl function, the {{- if contains "ambassador" .Release.Name -}} always get executed and never able to override the name

{{/*
Expand the name of the chart.
*/}}
{{- define "ambassador.name" -}}
{{- if contains "ambassador" .Release.Name -}}
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}

To Reproduce
Steps to reproduce the behavior:
Deploy emissary-ingress with release name as ambassador and override with differentname
You cannot rename the below lebel which is used by selectors on the service. It is a problem when you manage multiple emissary ingress with dependent charts where the release name is ambassador.
app.kubernetes.io/name: ambassador

Expected behavior

The nameoveride should come as the first condition on the if statement, because this is submitted optionally. And the release name should go as default.

Additional context
Add any other context about the problem here.