Skip to content

Commit 0fd3958

Browse files
manishrawat1992Manish Rawat
andauthored
fixed pod template to support clickhouse upgrades (#37)
* fixed pod template to support clickhouse upgrades * wip * added podHash instead of version for future scalability * wip * wip --------- Co-authored-by: Manish Rawat <manish@Manishs-MacBook-Air.local>
1 parent 2eb731d commit 0fd3958

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

charts/clickhouse/templates/_helpers.tpl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ If release name contains chart name it will be used as a full name.
3232
{{- end }}
3333
{{- end }}
3434

35+
{{- define "clickhouse.version" -}}
36+
{{ .Values.clickhouse.image.repository }}:{{ .Values.clickhouse.image.tag | default .Chart.AppVersion }}
37+
{{- end }}
38+
3539
{{/*
3640
Create chart name and version as used by the chart label.
3741
*/}}
@@ -132,7 +136,9 @@ Pod Template Base
132136
Pod Template Name
133137
*/}}
134138
{{- define "clickhouse.podTemplateName" -}}
135-
{{- printf "%s-pod" (include "clickhouse.fullname" .) | replace "+" "_" | trunc 63 | trimSuffix "-" }}
139+
{{- $podDescString := printf "%s-%s" (include "clickhouse.fullname" .) (include "clickhouse.version" .) }}
140+
{{- $podHash := $podDescString | sha256sum | trunc 8 }}
141+
{{- printf "%s-pod-%s" (include "clickhouse.fullname" .) $podHash | replace "+" "_" | trunc 63 | trimSuffix "-" }}
136142
{{- end }}
137143

138144
{{/*

0 commit comments

Comments
 (0)