@@ -9,25 +9,37 @@ Expand the name of the chart.
9
9
newFullname is the name used after 1.1.x release, in an effort to make the release name shorter.
10
10
*/} }
11
11
{ {- define " marklogic.newFullname" -} }
12
+ { {- if .Values.fullnameOverride } }
13
+ { {- .Values.fullnameOverride | trunc 63 | trimSuffix " -" } }
14
+ { {- else } }
12
15
{ {- .Release.Name | trunc 63 | trimSuffix " -" } }
13
16
{ {- end } }
17
+ { {- end } }
18
+
14
19
15
20
{ {/*
16
21
oldFullname is the name used before 1.1.x release
17
22
*/} }
18
23
{ {- define " marklogic.oldFullname" -} }
24
+ { {- if .Values.fullnameOverride } }
25
+ { {- .Values.fullnameOverride | trunc 63 | trimSuffix " -" } }
26
+ { {- else } }
19
27
{ {- $name := default .Chart.Name .Values.nameOverride } }
20
28
{ {- if contains $name .Release.Name } }
21
29
{ {- .Release.Name | trunc 63 | trimSuffix " -" } }
22
30
{ {- else } }
23
31
{ {- printf " %s-%s" .Release.Name $name | trunc 63 | trimSuffix " -" } }
24
32
{ {- end } }
25
33
{ {- end } }
34
+ { {- end } }
26
35
27
36
{ {- define " marklogic.shouldUseNewName" -} }
28
37
{ {- if .Release.IsInstall -} }
29
38
{ {- true } }
30
39
{ {- else } }
40
+ { {- if .Values.fullnameOverride -} }
41
+ { {- false } }
42
+ { {- else } }
31
43
{ {- $newCm := (lookup " apps/v1" " StatefulSet" .Release.Namespace (include " marklogic.newFullname" .)) } }
32
44
{ {- if $newCm } }
33
45
{ {- true } }
@@ -36,6 +48,7 @@ oldFullname is the name used before 1.1.x release
36
48
{ {- end } }
37
49
{ {- end } }
38
50
{ {- end } }
51
+ { {- end } }
39
52
40
53
{ {/*
41
54
Create a default fully qualified app name.
@@ -44,16 +57,12 @@ To surrport the upgrade from 1.0.x to 1.1.x, we keep the old name when doing upg
44
57
For the new install, we use the new name, which is the release name.
45
58
*/} }
46
59
{ {- define " marklogic.fullname" -} }
47
- { {- if .Values.fullnameOverride } }
48
- { {- .Values.fullnameOverride | trunc 63 | trimSuffix " -" } }
49
- { {- else } }
50
60
{ {- if eq (include " marklogic.shouldUseNewName" .) " true" -} }
51
61
{ {- include " marklogic.newFullname" . } }
52
62
{ {- else } }
53
63
{ {- include " marklogic.oldFullname" . } }
54
64
{ {- end } }
55
65
{ {- end } }
56
- { {- end } }
57
66
58
67
{ {/*
59
68
Create chart name and version as used by the chart label.
@@ -76,6 +85,20 @@ Create headless service name for statefulset
76
85
{{- end} }
77
86
78
87
88
+ { {/*
89
+ Create cluster service name for statefulset
90
+ */} }
91
+ { {- define " marklogic.clusterServiceName" -} }
92
+ { {- if eq (include " marklogic.shouldUseNewName" .) " true" -} }
93
+ { {- include " marklogic.newFullname" . } }-cluster
94
+ { {- else } }
95
+ { {- include " marklogic.oldFullname" . } }
96
+ { {- end } }
97
+ { {- end } }
98
+ { {/*
99
+ {{- end} }
100
+
101
+
79
102
{ {/*
80
103
Create URL for headless service
81
104
*/} }
0 commit comments