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=c506a59ca4e94262a34911759a425bf7f27e309c;hpb=f127b33c7ac113cf0544f3685d9ba4b631cc2e00;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 c506a59c..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,78 +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: - - - .Values.nsPrefix : override namespace prefix -*/}} - {{- define "common.namespace.platform" -}} - {{- if .Values.global -}} - {{- if .Values.global.namespace -}} - {{- if .Values.global.namespace.platform -}} - {{- printf "%s" .Values.global.namespace.platform -}} - {{- else -}} - {{- printf "ricplt" -}} - {{- end -}} - {{- else -}} - {{- printf "ricplt" -}} - {{- end -}} + {{- $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.aux" -}} - {{- if .Values.global -}} - {{- if .Values.global.namespace -}} - {{- if .Values.global.namespace.aux -}} - {{- printf "%s" .Values.global.namespace.aux -}} - {{- else -}} - {{- printf "ricaux" -}} - {{- end -}} - {{- else -}} - {{- printf "ricaux" -}} - {{- 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 "ricaux" -}} + {{- printf "ricinfra" -}} {{- end -}} {{- end -}} {{- define "common.namespace.xapp" -}} - {{- if .Values.global -}} - {{- if .Values.global.namespace -}} - {{- if .Values.global.namespace.xapp -}} - {{- printf "%s" .Values.global.namespace.xapp -}} - {{- else -}} - {{- printf "ricxapp" -}} - {{- end -}} - {{- else -}} - {{- printf "ricxapp" -}} - {{- end -}} + {{- $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 -}} -{{- define "common.namespace.infra" -}} - {{- if .Values.global -}} - {{- if .Values.global.namespace -}} - {{- if .Values.global.namespace.infra -}} - {{- printf "%s" .Values.global.namespace.infra -}} - {{- else -}} - {{- printf "ricinfra" -}} - {{- end -}} - {{- else -}} - {{- printf "ricinfra" -}} - {{- end -}} + +{{- 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 "ricinfra" -}} + {{- printf "ricaux" -}} {{- end -}} {{- end -}} - -{{- define "common.namespace" -}} - {{- default .Release.Namespace .Values.nsPrefix -}} -{{- end -}}