Skip to content

Commit 3c59719

Browse files
pengzhoumlPeng Zhou
andauthored
MLE-14114: Fix bug for Helm upgrade when fullnameOverride is set (#228)
* MLE-14114: fix bug for fullnameOverride with upgrade * fix typo --------- Co-authored-by: Peng Zhou <[email protected]>
1 parent 54877ff commit 3c59719

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

charts/templates/_helpers.tpl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,18 @@ oldFullname is the name used before 1.1.x release
3838
{{- true }}
3939
{{- else }}
4040
{{- if .Values.fullnameOverride -}}
41+
{{- $overridenName := trim .Values.fullnameOverride -}}
42+
{{- $labels := (lookup "apps/v1" "StatefulSet" .Release.Namespace $overridenName).metadata.labels -}}
43+
{{- $chartVersionFull := get $labels "helm.sh/chart" -}}
44+
{{- $chartVersionString := trimPrefix "marklogic-" $chartVersionFull -}}
45+
{{- $chartVersionString := $chartVersionString | replace "." "" -}}
46+
{{- $chartVersionDigit := int $chartVersionString}}
47+
{{- if lt $chartVersionDigit 110 -}}
4148
{{- false }}
4249
{{- else }}
50+
{{- true }}
51+
{{- end }}
52+
{{- else }}
4353
{{- $newCm := (lookup "apps/v1" "StatefulSet" .Release.Namespace (include "marklogic.newFullname" .)) }}
4454
{{- if $newCm }}
4555
{{- true }}

0 commit comments

Comments
 (0)