X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=ric-common%2FCommon-Template%2Fhelm%2Fric-common%2Ftemplates%2F_context_locator.tpl;fp=ric-common%2FCommon-Template%2Fhelm%2Fric-common%2Ftemplates%2F_helm_credential_name.tpl;h=5155dec752eb8befde385a9e61e7010aa87d0b42;hb=dc00cdf008775e2ac5dddb186d1eb81e80370b69;hp=cac7f1f51d9377a1a609d71764be15436dadfde6;hpb=ca9b3ee64b3966fa1d20226b361b4f614434129e;p=it%2Fdep.git diff --git a/ric-common/Common-Template/helm/ric-common/templates/_helm_credential_name.tpl b/ric-common/Common-Template/helm/ric-common/templates/_context_locator.tpl similarity index 71% rename from ric-common/Common-Template/helm/ric-common/templates/_helm_credential_name.tpl rename to ric-common/Common-Template/helm/ric-common/templates/_context_locator.tpl index cac7f1f5..5155dec7 100644 --- a/ric-common/Common-Template/helm/ric-common/templates/_helm_credential_name.tpl +++ b/ric-common/Common-Template/helm/ric-common/templates/_context_locator.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. # @@ -18,10 +17,21 @@ -{{- define "common.helmcred.prefix" -}} - {{- printf "secret-helm" -}} -{{- end -}} -{{- define "common.helmcert.prefix" -}} - {{- printf "configmap-helm" -}} +{{- define "locate" -}} + {{- $ctx := .ctx }} + {{- $keylist := .keylist }} + {{- $currentkey := first $keylist -}} + {{- $restkeys := rest $keylist -}} + {{- if empty $restkeys -}} + {{- $result := index $ctx $currentkey -}} + {{- if not (empty $result) -}} + {{- $result -}} + {{- end -}} + {{- else -}} + {{- with index $ctx $currentkey }} + {{- $newctx := dict "ctx" . "keylist" $restkeys -}} + {{- include "locate" $newctx -}} + {{- end -}} + {{- end -}} {{- end -}}