Skip to content

Commit 35ea8d7

Browse files
committed
fix helm2 compatibility and ingress with tls
1 parent e2e708d commit 35ea8d7

4 files changed

Lines changed: 25 additions & 28 deletions

File tree

charts/codimd/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ kubeVersion: ">=1.14.0-0"
2020

2121
# This is the chart version. This version number should be incremented each time you make changes
2222
# to the chart and its templates, including the app version.
23-
version: 0.1.3
23+
version: 0.1.4
2424

2525
# This is the version number of the application being deployed. This version number should be
2626
# incremented each time you make changes to the application.

charts/codimd/templates/NOTES.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ NOTE: It may take a few minutes for the LoadBalancer IP to be available.
1414
Watch the status with: 'kubectl get svc --namespace {{ .Release.Namespace }} -w {{ template "codimd.fullname" . }} '
1515
{{ else if .Values.ingress.enabled }}
1616
{{ if .Values.ingress.tlsSecret }}
17-
Your CodiMD is located in: http://{{ .Values.ingress.hostname }}/
18-
{{ else }}
1917
Your CodiMD is located in: https://{{ .Values.ingress.hostname }}/
18+
{{ else }}
19+
Your CodiMD is located in: http://{{ .Values.ingress.hostname }}/
2020
{{ end }}
2121
{{ end }}

charts/codimd/templates/_helpers.tpl

Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -117,28 +117,24 @@ Helm 2.11 supports the assignment of a value to a variable defined in a differen
117117
but Helm 2.9 and 2.10 does not support it, so we need to implement this if-else logic.
118118
*/}}
119119
{{- if .Values.global -}}
120-
{{- if .Values.global.storageClass -}}
121-
{{- if (eq "-" .Values.global.storageClass) -}}
122-
{{- printf "storageClassName: \"\"" -}}
123-
{{- else }}
124-
{{- printf "storageClassName: %s" .Values.global.storageClass -}}
125-
{{- end -}}
126-
{{- else -}}
127-
{{- if .Values.codimd.imageStorePersistentVolume.storageClass -}}
128-
{{- if (eq "-" .Values.codimd.imageStorePersistentVolume.storageClass) -}}
129-
{{- printf "storageClassName: \"\"" -}}
130-
{{- else }}
131-
{{- printf "storageClassName: %s" .Values.codimd.imageStorePersistentVolume.storageClass -}}
132-
{{- end -}}
133-
{{- end -}}
120+
{{- if .Values.global.storageClass -}}
121+
{{- if (eq "-" .Values.global.storageClass) -}}
122+
{{- printf "storageClassName: \"\"" -}}
123+
{{- else }}
124+
{{- printf "storageClassName: %s" .Values.global.storageClass -}}
134125
{{- end -}}
135-
{{- else -}}
136-
{{- if .Values.codimd.imageStorePersistentVolume.storageClass -}}
137-
{{- if (eq "-" .Values.codimd.imageStorePersistentVolume.storageClass) -}}
138-
{{- printf "storageClassName: \"\"" -}}
139-
{{- else }}
140-
{{- printf "storageClassName: %s" .Values.codimd.imageStorePersistentVolume.storageClass -}}
141-
{{- end -}}
142-
{{- end -}}
143-
{{- end -}}
126+
{{- end -}}
127+
{{- else if .Values.storageClass -}}
128+
{{- if (eq "-" .Values.storageClass) -}}
129+
{{- printf "storageClassName: \"\"" -}}
130+
{{- else }}
131+
{{- printf "storageClassName: %s" .Values.storageClass -}}
132+
{{- end -}}
133+
{{- else if .Values.codimd.imageStorePersistentVolume.storageClass -}}
134+
{{- if (eq "-" .Values.codimd.imageStorePersistentVolume.storageClass) -}}
135+
{{- printf "storageClassName: \"\"" -}}
136+
{{- else }}
137+
{{- printf "storageClassName: %s" .Values.codimd.imageStorePersistentVolume.storageClass -}}
138+
{{- end -}}
144139
{{- end -}}
140+
{{- end -}}

charts/codimd/templates/ingress.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ metadata:
55
name: {{ template "codimd.fullname" . }}
66
{{ if .Values.ingress.annotation}}
77
annotations:
8-
{{ .Values.ingress.annotation | nindent 4 }}
8+
{{ toYaml .Values.ingress.annotation | nindent 4 }}
99
{{ end }}
1010
spec:
1111
rules:
@@ -17,7 +17,8 @@ spec:
1717
servicePort: 80
1818
{{ if .Values.ingress.tlsSecret }}
1919
tls:
20-
- hosts: {{ .Values.ingress.hostname }}
20+
- hosts:
21+
- {{ .Values.ingress.hostname }}
2122
secretName: {{ .Values.ingress.tlsSecret }}
2223
{{ end }}
2324
{{ end }}

0 commit comments

Comments
 (0)