From fb680815db6b8d6785859a112de0c7ab10cf934b Mon Sep 17 00:00:00 2001 From: Tim Smyth Date: Fri, 19 Jul 2024 11:56:53 +0200 Subject: [PATCH] nameoverride --- aws/didymosxr/nginx/templates/_helpers.tpl | 8 ++++---- aws/didymosxr/nginx/templates/route.yaml | 2 +- aws/didymosxr/nginx/values.yaml | 1 + 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/aws/didymosxr/nginx/templates/_helpers.tpl b/aws/didymosxr/nginx/templates/_helpers.tpl index 843b2178..d254380a 100644 --- a/aws/didymosxr/nginx/templates/_helpers.tpl +++ b/aws/didymosxr/nginx/templates/_helpers.tpl @@ -2,7 +2,7 @@ Expand the name of the chart. */}} {{- define "nginx.name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} +{{- default .Chart.Name .Values.nginx.nameOverride | trunc 63 | trimSuffix "-" }} {{- end }} {{/* @@ -11,10 +11,10 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this If release name contains chart name it will be used as a full name. */}} {{- define "nginx.fullname" -}} -{{- if .Values.fullnameOverride }} -{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} +{{- if .Values.nginx.fullnameOverride }} +{{- .Values.nginx.fullnameOverride | trunc 63 | trimSuffix "-" }} {{- else }} -{{- $name := default .Chart.Name .Values.nameOverride }} +{{- $name := default .Chart.Name .Values.nginx.nameOverride }} {{- if contains $name .Release.Name }} {{- .Release.Name | trunc 63 | trimSuffix "-" }} {{- else }} diff --git a/aws/didymosxr/nginx/templates/route.yaml b/aws/didymosxr/nginx/templates/route.yaml index 7d07504a..96cbacbb 100644 --- a/aws/didymosxr/nginx/templates/route.yaml +++ b/aws/didymosxr/nginx/templates/route.yaml @@ -15,7 +15,7 @@ spec: host: {{ .Values.nginx.route.host }} to: kind: Service - name: {{ $fullName }} + name: {{ include "nginx.fullname" . }} {{- if .Values.nginx.route.tls }} tls: {{- with .Values.nginx.route.tls }} diff --git a/aws/didymosxr/nginx/values.yaml b/aws/didymosxr/nginx/values.yaml index 09128cf9..6763a764 100644 --- a/aws/didymosxr/nginx/values.yaml +++ b/aws/didymosxr/nginx/values.yaml @@ -1,4 +1,5 @@ nginx: + fullnameOverride: didymosxr-nginx service: type: ClusterIP route: