Add NONRTRIC DME ACM Participant charts
[it/dep.git] / ric-common / Common-Template / helm / ric-common / templates / _namespace.tpl
index a657432..d2df3ee 100644 (file)
@@ -1,6 +1,5 @@
 ################################################################################
 #   Copyright (c) 2019 AT&T Intellectual Property.                             #
-#   Copyright (c) 2019 Nokia.                                                  #
 #                                                                              #
 #   Licensed under the Apache License, Version 2.0 (the "License");            #
 #   you may not use this file except in compliance with the License.           #
 #   limitations under the License.                                             #
 ################################################################################
 
-{{/*
-  Resolve the namespace to apply to a chart. The default namespace suffix
-  is the name of the chart. This can be overridden if necessary (eg. for subcharts)
-  using the following value:
+{{- define "common.namespace.platform" -}}
+  {{- $keylist := list "common" "namespace" "platform" -}}
+  {{- $ctx := dict "ctx" $.Values "keylist" $keylist -}}
+  {{- $namespace := include "locate" $ctx -}}
+  {{- if not (empty $namespace) -}}
+    {{- $namespace -}}
+  {{- else -}}
+    {{- printf "ricplt" -}}
+  {{- end -}}
+{{- end -}}
+
+{{- define "common.namespace.infra" -}}
+  {{- $keylist := list "common" "namespace" "infra" -}}
+  {{- $ctx := dict "ctx" $.Values "keylist" $keylist -}}
+  {{- $namespace := include "locate" $ctx -}}
+  {{- if not (empty $namespace) -}}
+    {{- $namespace -}}
+  {{- else -}}
+    {{- printf "ricinfra" -}}
+  {{- end -}}
+{{- end -}}
+
+{{- define "common.namespace.xapp" -}}
+  {{- $keylist := list "common" "namespace" "xapp" -}}
+  {{- $ctx := dict "ctx" $.Values "keylist" $keylist -}}
+  {{- $namespace := include "locate" $ctx -}}
+  {{- if not (empty $namespace) -}}
+    {{- $namespace -}}
+  {{- else -}}
+    {{- printf "ricxapp" -}}
+  {{- end -}}
+{{- end -}}
+
 
-  - .Values.nsPrefix  : override namespace prefix
-*/}}
-{{- define "common.namespace" -}}
-  {{- default .Release.Namespace .Values.nsPrefix -}}
+{{- define "common.namespace.aux" -}}
+  {{- $keylist := list "common" "namespace" "aux" -}}
+  {{- $ctx := dict "ctx" $.Values "keylist" $keylist -}}
+  {{- $namespace := include "locate" $ctx -}}
+  {{- if not (empty $namespace) -}}
+    {{- $namespace -}}
+  {{- else -}}
+    {{- printf "ricaux" -}}
+  {{- end -}}
 {{- end -}}