f86bc241fb3131e99e9bf749ca7f3c1244473bdf
[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.a1mediator" -}}
142   {{- if .Values.a1mediator -}}
143     {{- if .Values.a1mediator.nameOverride -}}
144       {{- printf "%s" .Values.a1mediator.nameOverride -}}
145     {{- else -}}
146       {{- printf "a1mediator" -}}
147     {{- end -}}
148   {{- else -}}
149     {{- printf "a1mediator" -}}
150   {{- end -}}
151 {{- end -}}
152
153
154 {{- define "common.fullname.a1mediator" -}}
155   {{- $name := ( include "common.name.a1mediator" . ) -}}
156   {{- $namespace := ( include "common.namespace.platform" . ) -}}
157   {{- printf "%s-%s" $namespace $name | trunc 63 | trimSuffix "-" -}}
158 {{- end -}}
159
160
161
162 {{- define "common.name.nexus" -}}
163   {{- if .Values.nexus -}}
164     {{- if .Values.nexus.nameOverride -}}
165       {{- printf "%s" .Values.nexus.nameOverride -}}
166     {{- else -}}
167       {{- printf "nexus" -}}
168     {{- end -}}
169   {{- else -}}
170     {{- printf "nexus" -}}
171   {{- end -}}
172 {{- end -}}
173
174
175 {{- define "common.fullname.nexus" -}}
176   {{- $name := ( include "common.name.nexus" . ) -}}
177   {{- $namespace := ( include "common.namespace.infra" . ) -}}
178   {{- printf "%s-%s" $namespace $name | trunc 63 | trimSuffix "-" -}}
179 {{- end -}}
180
181
182 {{- define "common.name.dashboard" -}}
183   {{- if .Values.dashboard -}}
184     {{- if .Values.dashboard.nameOverride -}}
185       {{- printf "%s" .Values.dashboard.nameOverride -}}
186     {{- else -}}
187       {{- printf "dashboard" -}}
188     {{- end -}}
189   {{- else -}}
190     {{- printf "dashboard" -}}
191   {{- end -}}
192 {{- end -}}
193
194
195 {{- define "common.fullname.dashboard" -}}
196   {{- $name := ( include "common.name.dashboard" . ) -}}
197   {{- $namespace := ( include "common.namespace.aux" . ) -}}
198   {{- printf "%s-%s" $namespace $name | trunc 63 | trimSuffix "-" -}}
199 {{- end -}}
200
201 {{- define "common.name.messagerouter" -}}
202   {{- if .Values.messagerouter -}}
203     {{- if .Values.messagerouter.nameOverride -}}
204       {{- printf "%s" .Values.messagerouter.nameOverride -}}
205     {{- else -}}
206       {{- printf "messagerouter" -}}
207     {{- end -}}
208   {{- else -}}
209     {{- printf "messagerouter" -}}
210   {{- end -}}
211 {{- end -}}
212
213
214 {{- define "common.fullname.messagerouter" -}}
215   {{- $name := ( include "common.name.messagerouter" . ) -}}
216   {{- $namespace := ( include "common.namespace.aux" . ) -}}
217   {{- printf "%s-%s" $namespace $name | trunc 63 | trimSuffix "-" -}}
218 {{- end -}}
219
220
221 {{- define "common.name.ves" -}}
222   {{- if .Values.ves -}}
223     {{- if .Values.ves.nameOverride -}}
224       {{- printf "%s" .Values.ves.nameOverride -}}
225     {{- else -}}
226       {{- printf "ves" -}}
227     {{- end -}}
228   {{- else -}}
229     {{- printf "ves" -}}
230   {{- end -}}
231 {{- end -}}
232
233
234 {{- define "common.fullname.ves" -}}
235   {{- $name := ( include "common.name.ves" . ) -}}
236   {{- $namespace := ( include "common.namespace.aux" . ) -}}
237   {{- printf "%s-%s" $namespace $name | trunc 63 | trimSuffix "-" -}}
238 {{- end -}}
239
240 {{- define "common.name" -}}
241   {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
242 {{- end -}}
243
244 {{/*
245   Create a default fully qualified application name.
246   Truncated at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
247 */}}
248 {{- define "common.fullname" -}}
249   {{- $name := default .Chart.Name .Values.nameOverride -}}
250   {{- printf "%s-%s" .Release.Namespace $name | trunc 63 | trimSuffix "-" -}}
251 {{- end -}}