From 71057946e69128a29c4b06416bf16522930ac283 Mon Sep 17 00:00:00 2001 From: stefanprodan Date: Sun, 10 Feb 2019 17:38:33 +0200 Subject: [PATCH] Fix podinfo helm tests --- charts/podinfo/templates/_helpers.tpl | 10 ++++++++++ charts/podinfo/templates/tests/test-config.yaml | 6 +----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/charts/podinfo/templates/_helpers.tpl b/charts/podinfo/templates/_helpers.tpl index 60805fe6..3fe7a70f 100644 --- a/charts/podinfo/templates/_helpers.tpl +++ b/charts/podinfo/templates/_helpers.tpl @@ -31,3 +31,13 @@ Create chart name and version as used by the chart label. {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} {{- end -}} +{{/* +Create chart name suffix. +*/}} +{{- define "podinfo.suffix" -}} +{{- if .Values.canary.enabled -}} +{{- "-primary" -}} +{{- else -}} +{{- "" -}} +{{- end -}} +{{- end -}} \ No newline at end of file diff --git a/charts/podinfo/templates/tests/test-config.yaml b/charts/podinfo/templates/tests/test-config.yaml index dce297a1..49a95554 100755 --- a/charts/podinfo/templates/tests/test-config.yaml +++ b/charts/podinfo/templates/tests/test-config.yaml @@ -1,8 +1,4 @@ -{{- $suffix := "" -}} -{{- if .Values.canary.enabled -}} -{{- $suffix = "-primary" -}} -{{- end -}} -{{- $url := printf "%s%s:%v" (include "podinfo.fullname" .) $suffix .Values.service.port -}} +{{- $url := printf "%s%s.%s:%v" (include "podinfo.fullname" .) (include "podinfo.suffix" .) .Release.Namespace .Values.service.port -}} apiVersion: v1 kind: ConfigMap metadata: