6402565e99c44a1823c5cdbc67df9f17011b2353
[it/dep.git] / ric-common / Common-Template / helm / ric-common / templates / _name.tpl
1 ################################################################################
2 #   Copyright (c) 2019 AT&T Intellectual Property.                             #
3 #   Copyright (c) 2019 Nokia.                                                  #
4 #                                                                              #
5 #   Licensed under the Apache License, Version 2.0 (the "License");            #
6 #   you may not use this file except in compliance with the License.           #
7 #   You may obtain a copy of the License at                                    #
8 #                                                                              #
9 #       http://www.apache.org/licenses/LICENSE-2.0                             #
10 #                                                                              #
11 #   Unless required by applicable law or agreed to in writing, software        #
12 #   distributed under the License is distributed on an "AS IS" BASIS,          #
13 #   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   #
14 #   See the License for the specific language governing permissions and        #
15 #   limitations under the License.                                             #
16 ################################################################################
17
18 {{/*
19   This is the root file that define the name of each component. Value here will be used to define other K8S resource name.
20 */}}
21
22
23
24 {{- define "common.name.appmgr" -}}
25   {{- if .Values.appmgr -}}
26     {{- if .Values.appmgr.nameOverride -}}
27       {{- printf "%s" .Values.appmgr.nameOverride -}}
28     {{- else -}}
29       {{- printf "appmgr" -}}
30     {{- end -}}
31   {{- else -}}
32     {{- printf "appmgr" -}}
33   {{- end -}}
34 {{- end -}}
35
36 {{- define "common.fullname.appmgr" -}}
37   {{- $name := ( include "common.name.appmgr" . ) -}}
38   {{- $namespace := ( include "common.namespace.platform" . ) -}}
39   {{- printf "%s-%s" $namespace $name | trunc 63 | trimSuffix "-" -}}
40 {{- end -}}
41
42
43 {{- define "common.name.dbaas" -}}
44   {{- if .Values.dbaas -}}
45     {{- if .Values.dbaas.nameOverride -}}
46       {{- printf "%s" .Values.dbaas.nameOverride -}}
47     {{- else -}}
48       {{- printf "dbaas" -}}
49     {{- end -}}
50   {{- else -}}
51     {{- printf "dbaas" -}}
52   {{- end -}}
53 {{- end -}}
54
55 {{- define "common.fullname.dbaas" -}}
56   {{- $name := ( include "common.name.dbaas" . ) -}}
57   {{- $namespace := ( include "common.namespace.platform" . ) -}}
58   {{- printf "%s-%s" $namespace $name | trunc 63 | trimSuffix "-" -}}
59 {{- end -}}
60
61
62
63
64
65
66
67
68
69
70
71 {{- define "common.name.e2mgr" -}}
72   {{- if .Values.e2mgr -}}
73     {{- if .Values.e2mgr.nameOverride -}}
74       {{- printf "%s" .Values.e2mgr.nameOverride -}}
75     {{- else -}}
76       {{- printf "e2mgr" -}}
77     {{- end -}}
78   {{- else -}}
79     {{- printf "e2mgr" -}}
80   {{- end -}}
81 {{- end -}}
82
83
84 {{- define "common.fullname.e2mgr" -}}
85   {{- $name := ( include "common.name.e2mgr" . ) -}}
86   {{- $namespace := ( include "common.namespace.platform" . ) -}}
87   {{- printf "%s-%s" $namespace $name | trunc 63 | trimSuffix "-" -}}
88 {{- end -}}
89
90 {{- define "common.name.e2term" -}}
91   {{- if .Values.e2term -}}
92     {{- if .Values.e2term.nameOverride -}}
93       {{- printf "%s" .Values.e2term.nameOverride -}}
94     {{- else -}}
95       {{- printf "e2term" -}}
96     {{- end -}}
97   {{- else -}}
98     {{- printf "e2term" -}}
99   {{- end -}}
100 {{- end -}}
101
102
103 {{- define "common.fullname.e2term" -}}
104   {{- $name := ( include "common.name.e2term" . ) -}}
105   {{- $namespace := ( include "common.namespace.platform" . ) -}}
106   {{- printf "%s-%s" $namespace $name | trunc 63 | trimSuffix "-" -}}
107 {{- end -}}
108
109
110
111
112
113
114
115
116
117 {{- define "common.name.rtmgr" -}}
118   {{- if .Values.rtmgr -}}
119     {{- if .Values.rtmgr.nameOverride -}}
120       {{- printf "%s" .Values.rtmgr.nameOverride -}}
121     {{- else -}}
122       {{- printf "rtmgr" -}}
123     {{- end -}}
124   {{- else -}}
125     {{- printf "rtmgr" -}}
126   {{- end -}}
127 {{- end -}}
128
129
130 {{- define "common.fullname.rtmgr" -}}
131   {{- $name := ( include "common.name.rtmgr" . ) -}}
132   {{- $namespace := ( include "common.namespace.platform" . ) -}}
133   {{- printf "%s-%s" $namespace $name | trunc 63 | trimSuffix "-" -}}
134 {{- end -}}
135
136
137
138
139
140
141 {{- define "common.name.submgr" -}}
142   {{- if .Values.submgr -}}
143     {{- if .Values.submgr.nameOverride -}}
144       {{- printf "%s" .Values.submgr.nameOverride -}}
145     {{- else -}}
146       {{- printf "submgr" -}}
147     {{- end -}}
148   {{- else -}}
149     {{- printf "submgr" -}}
150   {{- end -}}
151 {{- end -}}
152
153
154 {{- define "common.fullname.submgr" -}}
155   {{- $name := ( include "common.name.submgr" . ) -}}
156   {{- $namespace := ( include "common.namespace.platform" . ) -}}
157   {{- printf "%s-%s" $namespace $name | trunc 63 | trimSuffix "-" -}}
158 {{- end -}}
159
160
161
162
163
164
165 {{- define "common.name.a1mediator" -}}
166   {{- if .Values.a1mediator -}}
167     {{- if .Values.a1mediator.nameOverride -}}
168       {{- printf "%s" .Values.a1mediator.nameOverride -}}
169     {{- else -}}
170       {{- printf "a1mediator" -}}
171     {{- end -}}
172   {{- else -}}
173     {{- printf "a1mediator" -}}
174   {{- end -}}
175 {{- end -}}
176
177
178 {{- define "common.fullname.a1mediator" -}}
179   {{- $name := ( include "common.name.a1mediator" . ) -}}
180   {{- $namespace := ( include "common.namespace.platform" . ) -}}
181   {{- printf "%s-%s" $namespace $name | trunc 63 | trimSuffix "-" -}}
182 {{- end -}}
183
184
185 {{- define "common.name.vespamgr" -}}
186   {{- if .Values.vespamgr -}}
187     {{- if .Values.vespamgr.nameOverride -}}
188       {{- printf "%s" .Values.vespamgr.nameOverride -}}
189     {{- else -}}
190       {{- printf "vespamgr" -}}
191     {{- end -}}
192   {{- else -}}
193     {{- printf "vespamgr" -}}
194   {{- end -}}
195 {{- end -}}
196
197
198 {{- define "common.fullname.vespamgr" -}}
199   {{- $name := ( include "common.name.vespamgr" . ) -}}
200   {{- $namespace := ( include "common.namespace.platform" . ) -}}
201   {{- printf "%s-%s" $namespace $name | trunc 63 | trimSuffix "-" -}}
202 {{- end -}}
203
204
205
206
207 {{- define "common.name.nexus" -}}
208   {{- if .Values.nexus -}}
209     {{- if .Values.nexus.nameOverride -}}
210       {{- printf "%s" .Values.nexus.nameOverride -}}
211     {{- else -}}
212       {{- printf "nexus" -}}
213     {{- end -}}
214   {{- else -}}
215     {{- printf "nexus" -}}
216   {{- end -}}
217 {{- end -}}
218
219
220 {{- define "common.fullname.nexus" -}}
221   {{- $name := ( include "common.name.nexus" . ) -}}
222   {{- $namespace := ( include "common.namespace.infra" . ) -}}
223   {{- printf "%s-%s" $namespace $name | trunc 63 | trimSuffix "-" -}}
224 {{- end -}}
225
226 {{- define "common.name.chartmuseum" -}}
227   {{- if .Values.chartmuseum -}}
228     {{- if .Values.chartmuseum.nameOverride -}}
229       {{- printf "%s" .Values.chartmuseum.nameOverride -}}
230     {{- else -}}
231       {{- printf "chartmuseum" -}}
232     {{- end -}}
233   {{- else -}}
234     {{- printf "chartmuseum" -}}
235   {{- end -}}
236 {{- end -}}
237
238
239 {{- define "common.fullname.chartmuseum" -}}
240   {{- $name := ( include "common.name.chartmuseum" . ) -}}
241   {{- $namespace := ( include "common.namespace.infra" . ) -}}
242   {{- printf "%s-%s" $namespace $name | trunc 63 | trimSuffix "-" -}}
243 {{- end -}}
244
245 {{- define "common.name.dashboard" -}}
246   {{- if .Values.dashboard -}}
247     {{- if .Values.dashboard.nameOverride -}}
248       {{- printf "%s" .Values.dashboard.nameOverride -}}
249     {{- else -}}
250       {{- printf "dashboard" -}}
251     {{- end -}}
252   {{- else -}}
253     {{- printf "dashboard" -}}
254   {{- end -}}
255 {{- end -}}
256
257
258 {{- define "common.fullname.dashboard" -}}
259   {{- $name := ( include "common.name.dashboard" . ) -}}
260   {{- $namespace := ( include "common.namespace.aux" . ) -}}
261   {{- printf "%s-%s" $namespace $name | trunc 63 | trimSuffix "-" -}}
262 {{- end -}}
263
264 {{- define "common.name.messagerouter" -}}
265   {{- if .Values.messagerouter -}}
266     {{- if .Values.messagerouter.nameOverride -}}
267       {{- printf "%s" .Values.messagerouter.nameOverride -}}
268     {{- else -}}
269       {{- printf "messagerouter" -}}
270     {{- end -}}
271   {{- else -}}
272     {{- printf "messagerouter" -}}
273   {{- end -}}
274 {{- end -}}
275
276
277 {{- define "common.fullname.messagerouter" -}}
278   {{- $name := ( include "common.name.messagerouter" . ) -}}
279   {{- $namespace := ( include "common.namespace.aux" . ) -}}
280   {{- printf "%s-%s" $namespace $name | trunc 63 | trimSuffix "-" -}}
281 {{- end -}}
282
283
284 {{- define "common.name.ves" -}}
285   {{- if .Values.ves -}}
286     {{- if .Values.ves.nameOverride -}}
287       {{- printf "%s" .Values.ves.nameOverride -}}
288     {{- else -}}
289       {{- printf "ves" -}}
290     {{- end -}}
291   {{- else -}}
292     {{- printf "ves" -}}
293   {{- end -}}
294 {{- end -}}
295
296
297 {{- define "common.fullname.ves" -}}
298   {{- $name := ( include "common.name.ves" . ) -}}
299   {{- $namespace := ( include "common.namespace.aux" . ) -}}
300   {{- printf "%s-%s" $namespace $name | trunc 63 | trimSuffix "-" -}}
301 {{- end -}}
302
303 {{- define "common.name" -}}
304   {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
305 {{- end -}}
306
307 {{/*
308   Create a default fully qualified application name.
309   Truncated at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
310 */}}
311 {{- define "common.fullname" -}}
312   {{- $name := default .Chart.Name .Values.nameOverride -}}
313   {{- printf "%s-%s" .Release.Namespace $name | trunc 63 | trimSuffix "-" -}}
314 {{- end -}}