X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=ric-common%2FCommon-Template%2Fhelm%2Fric-common%2Ftemplates%2F_namespace.tpl;h=d2df3eefe519ac56a74be800964eee1594518c7b;hb=7a8f974a3815cc8a17041dbba4154cd2c799ac4e;hp=a657432bcc4a92d984ef6d6a95de7b7dfe498f83;hpb=f63773cf637d9cfa516459cc9a0f951542811aaa;p=it%2Fdep.git diff --git a/ric-common/Common-Template/helm/ric-common/templates/_namespace.tpl b/ric-common/Common-Template/helm/ric-common/templates/_namespace.tpl index a657432b..d2df3eef 100644 --- a/ric-common/Common-Template/helm/ric-common/templates/_namespace.tpl +++ b/ric-common/Common-Template/helm/ric-common/templates/_namespace.tpl @@ -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. # @@ -15,13 +14,47 @@ # 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 -}}