diff --git a/charts/policy-reporter/charts/ui/templates/_helpers.tpl b/charts/policy-reporter/charts/ui/templates/_helpers.tpl index 4a71a126..fe444578 100644 --- a/charts/policy-reporter/charts/ui/templates/_helpers.tpl +++ b/charts/policy-reporter/charts/ui/templates/_helpers.tpl @@ -75,9 +75,13 @@ Create the name of the service account to use {{- define "ui.policyReportServiceName" -}} {{- $name := .Chart.Name }} -{{- if .Values.global.fullnameOverride }} -{{- .Values.global.fullnameOverride }} -{{- else }} +{{- if .Values.global.backend }} {{- .Values.global.backend }} +{{- else if .Values.global.fullnameOverride }} +{{- .Values.global.fullnameOverride }} +{{- else if contains $name .Release.Name }} +{{- .Release.Name | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} {{- end }} {{- end }} diff --git a/charts/policy-reporter/values.yaml b/charts/policy-reporter/values.yaml index 71a27869..e49e664c 100644 --- a/charts/policy-reporter/values.yaml +++ b/charts/policy-reporter/values.yaml @@ -99,8 +99,8 @@ global: plugins: # enable kyverno for Policy Reporter UI and monitoring keyverno: false - # The name of service policy-report. If you changed ReleaseName you have to replace it - backend: policy-reporter + # The name of service policy-report. Defaults to ReleaseName. + backend: "" # Service Port number port: 8080 fullnameOverride: ""