c506a59ca4e94262a34911759a425bf7f27e309c
[it/dep.git] / ric-common / Common-Template / helm / ric-common / templates / _namespace.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   Resolve the namespace to apply to a chart. The default namespace suffix
20   is the name of the chart. This can be overridden if necessary (eg. for subcharts)
21   using the following value:
22
23   - .Values.nsPrefix  : override namespace prefix
24 */}}
25
26 {{- define "common.namespace.platform" -}}
27   {{- if .Values.global -}}
28     {{- if .Values.global.namespace -}}
29       {{- if .Values.global.namespace.platform -}}
30         {{- printf "%s" .Values.global.namespace.platform -}}
31       {{- else -}}
32         {{- printf "ricplt" -}}
33       {{- end -}}
34     {{- else -}}
35       {{- printf "ricplt" -}}
36     {{- end -}}
37   {{- else -}}
38     {{- printf "ricplt" -}}
39   {{- end -}}
40 {{- end -}}
41
42 {{- define "common.namespace.aux" -}}
43   {{- if .Values.global -}}
44     {{- if .Values.global.namespace -}}
45       {{- if .Values.global.namespace.aux -}}
46         {{- printf "%s" .Values.global.namespace.aux -}}
47       {{- else -}}
48         {{- printf "ricaux" -}}
49       {{- end -}}
50     {{- else -}}
51       {{- printf "ricaux" -}}
52     {{- end -}}
53   {{- else -}}
54     {{- printf "ricaux" -}}
55   {{- end -}}
56 {{- end -}}
57
58 {{- define "common.namespace.xapp" -}}
59   {{- if .Values.global -}}
60     {{- if .Values.global.namespace -}}
61       {{- if .Values.global.namespace.xapp -}}
62         {{- printf "%s" .Values.global.namespace.xapp -}}
63       {{- else -}}
64         {{- printf "ricxapp" -}}
65       {{- end -}}
66     {{- else -}}
67       {{- printf "ricxapp" -}}
68     {{- end -}}
69   {{- else -}}
70     {{- printf "ricxapp" -}}
71   {{- end -}}
72 {{- end -}}
73
74 {{- define "common.namespace.infra" -}}
75   {{- if .Values.global -}}
76     {{- if .Values.global.namespace -}}
77       {{- if .Values.global.namespace.infra -}}
78         {{- printf "%s" .Values.global.namespace.infra -}}
79       {{- else -}}
80         {{- printf "ricinfra" -}}
81       {{- end -}}
82     {{- else -}}
83       {{- printf "ricinfra" -}}
84     {{- end -}}
85   {{- else -}}
86     {{- printf "ricinfra" -}}
87   {{- end -}}
88 {{- end -}}
89
90 {{- define "common.namespace" -}}
91   {{- default .Release.Namespace .Values.nsPrefix -}}
92 {{- end -}}