################################################################################
# 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. #
-{{- 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 -}}