Skip to content

Commit

Permalink
Fix podinfo helm tests
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanprodan committed Feb 10, 2019
1 parent a74ad52 commit 7105794
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
10 changes: 10 additions & 0 deletions charts/podinfo/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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 -}}
6 changes: 1 addition & 5 deletions charts/podinfo/templates/tests/test-config.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down

0 comments on commit 7105794

Please sign in to comment.