From a05ab40bdcfcb2cf002ba236435f8ef82b94519e Mon Sep 17 00:00:00 2001 From: Max Date: Tue, 9 Apr 2019 15:15:09 +0200 Subject: [PATCH] [stable/parse] fix ingress template (#12909) * fixed usage of non existing template function and only generating dashboard ingress if enabled Signed-off-by: Max Enelund * bump chart version Signed-off-by: Max Enelund * added template function for chart Signed-off-by: Max Enelund * do not generate tls structure for dashboard if not enabled Signed-off-by: Max Enelund --- stable/parse/Chart.yaml | 2 +- stable/parse/templates/_helpers.tpl | 7 +++++++ stable/parse/templates/dashboard-deployment.yaml | 2 +- stable/parse/templates/ingress.yaml | 10 +++++++--- stable/parse/templates/pvc.yaml | 2 +- stable/parse/templates/secrets.yaml | 2 +- stable/parse/templates/server-deployment.yaml | 2 +- stable/parse/templates/svc.yaml | 2 +- 8 files changed, 20 insertions(+), 9 deletions(-) diff --git a/stable/parse/Chart.yaml b/stable/parse/Chart.yaml index 9590fef6fb..5478546ff4 100644 --- a/stable/parse/Chart.yaml +++ b/stable/parse/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 name: parse -version: 6.2.2 +version: 6.2.3 appVersion: 3.2.3 description: Parse is a platform that enables users to add a scalable and powerful backend to launch a full-featured app for iOS, Android, JavaScript, Windows, Unity, and more. keywords: diff --git a/stable/parse/templates/_helpers.tpl b/stable/parse/templates/_helpers.tpl index b7a1a5352a..ef3f175a91 100644 --- a/stable/parse/templates/_helpers.tpl +++ b/stable/parse/templates/_helpers.tpl @@ -6,6 +6,13 @@ Expand the name of the chart. {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} {{- end -}} +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "parse.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} +{{- end -}} + {{/* Create a default fully qualified app name. We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). diff --git a/stable/parse/templates/dashboard-deployment.yaml b/stable/parse/templates/dashboard-deployment.yaml index 83305afd6d..36fb07a514 100644 --- a/stable/parse/templates/dashboard-deployment.yaml +++ b/stable/parse/templates/dashboard-deployment.yaml @@ -5,7 +5,7 @@ metadata: name: {{ template "parse.fullname" . }}-dashboard labels: app: {{ template "parse.name" . }} - chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + chart: {{ template "parse.chart" . }} release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" component: "dashboard" diff --git a/stable/parse/templates/ingress.yaml b/stable/parse/templates/ingress.yaml index 2761e8277b..54bb77cca4 100644 --- a/stable/parse/templates/ingress.yaml +++ b/stable/parse/templates/ingress.yaml @@ -4,8 +4,8 @@ kind: Ingress metadata: name: {{ template "parse.fullname" . }} labels: - app: "{{ template "parse.fullname" . }}" - chart: "{{ template "parse.chart" . }}" + app: {{ template "parse.fullname" . }} + chart: {{ template "parse.chart" . }} release: {{ .Release.Name | quote }} heritage: {{ .Release.Service | quote }} annotations: @@ -17,7 +17,8 @@ metadata: {{- end }} spec: rules: - {{- range .Values.ingress.dashbard.hosts }} + {{- if .Values.dashboard.enabled }} + {{- range .Values.ingress.dashboard.hosts }} - host: {{ .name }} http: paths: @@ -26,6 +27,7 @@ spec: serviceName: {{ template "parse.fullname" $ }} servicePort: dashboard-http {{- end }} + {{- end }} {{- range .Values.ingress.server.hosts }} - host: {{ .name }} http: @@ -36,6 +38,7 @@ spec: servicePort: server-http {{- end }} tls: + {{- if .Values.dashboard.enabled }} {{- range .Values.ingress.dashboard.hosts }} {{- if .tls }} - hosts: @@ -49,6 +52,7 @@ spec: secretName: {{ .tlsSecret }} {{- end }} {{- end }} + {{- end }} {{- range .Values.ingress.server.hosts }} {{- if .tls }} - hosts: diff --git a/stable/parse/templates/pvc.yaml b/stable/parse/templates/pvc.yaml index 97ea4720b6..e840f003ac 100644 --- a/stable/parse/templates/pvc.yaml +++ b/stable/parse/templates/pvc.yaml @@ -5,7 +5,7 @@ metadata: name: {{ template "parse.fullname" . }} labels: app: {{ template "parse.name" . }} - chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + chart: {{ template "parse.chart" . }} release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" spec: diff --git a/stable/parse/templates/secrets.yaml b/stable/parse/templates/secrets.yaml index 2acf9a4497..40b37625ba 100644 --- a/stable/parse/templates/secrets.yaml +++ b/stable/parse/templates/secrets.yaml @@ -4,7 +4,7 @@ metadata: name: {{ template "parse.fullname" . }} labels: app: {{ template "parse.name" . }} - chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + chart: {{ template "parse.chart" . }} release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" type: Opaque diff --git a/stable/parse/templates/server-deployment.yaml b/stable/parse/templates/server-deployment.yaml index 8448a51a29..bba9a358de 100644 --- a/stable/parse/templates/server-deployment.yaml +++ b/stable/parse/templates/server-deployment.yaml @@ -4,7 +4,7 @@ metadata: name: {{ template "parse.fullname" . }}-server labels: app: {{ template "parse.name" . }} - chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + chart: {{ template "parse.chart" . }} release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" component: "server" diff --git a/stable/parse/templates/svc.yaml b/stable/parse/templates/svc.yaml index 24601b38d3..a7afc1011d 100644 --- a/stable/parse/templates/svc.yaml +++ b/stable/parse/templates/svc.yaml @@ -4,7 +4,7 @@ metadata: name: {{ template "parse.fullname" . }} labels: app: {{ template "parse.name" . }} - chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + chart: {{ template "parse.chart" . }} release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" spec: