summaryrefslogtreecommitdiffstats
path: root/kubernetes/common
diff options
context:
space:
mode:
authorSylvain Desbureaux <sylvain.desbureaux@orange.com>2020-03-09 15:00:35 +0000
committerGerrit Code Review <gerrit@onap.org>2020-03-09 15:00:35 +0000
commit1fe2bbe04b2f81623661105d4d8ef32286122257 (patch)
tree10fe1a71cbebd3da7c60a1a0d37223cc6db0ce2e /kubernetes/common
parent217dc47798a9e03fb8d06bfc7a5cfdcb32f2556f (diff)
parent424a506b76ad2cc158acb58fb4fb06d162841ce5 (diff)
Merge "[COMMON] Allow to attach annotations to secrets"
Diffstat (limited to 'kubernetes/common')
-rw-r--r--kubernetes/common/common/templates/_secret.yaml9
1 files changed, 8 insertions, 1 deletions
diff --git a/kubernetes/common/common/templates/_secret.yaml b/kubernetes/common/common/templates/_secret.yaml
index e24a2e4ba7..9f41906c9e 100644
--- a/kubernetes/common/common/templates/_secret.yaml
+++ b/kubernetes/common/common/templates/_secret.yaml
@@ -22,6 +22,7 @@
The template takes two arguments:
- .global: environment (.)
- .name: name of the secret
+ - .annotations: annotations which should be used
Example call:
{{ include "common.secret._header" (dict "global" . "name" "myFancyName") }}
@@ -39,6 +40,9 @@ metadata:
chart: {{ $global.Chart.Name }}-{{ $global.Chart.Version | replace "+" "_" }}
release: {{ include "common.release" $global }}
heritage: {{ $global.Release.Service }}
+{{- if .annotations }}
+ annotations: {{- include "common.tplValue" (dict "value" .annotations "context" $global) | nindent 4 }}
+{{- end }}
type: Opaque
{{- end -}}
@@ -204,6 +208,8 @@ valueFrom:
- name:
Overrides default secret name generation and allows to set immutable
and globaly unique name
+ - annotations:
+ List of annotations to be used while defining a secret
To allow sharing a secret between the components and allow to pre-deploy secrets
before ONAP deployment it is possible to use already existing secret instead of
@@ -239,11 +245,12 @@ valueFrom:
{{- range $secret := .Values.secrets }}
{{- $uid := tpl (default "" $secret.uid) $global }}
{{- $name := include "common.secret.genName" (dict "global" $global "uid" $uid "name" $secret.name) }}
+ {{- $annotations := default "" $secret.annotations }}
{{- $type := default "generic" $secret.type }}
{{- $externalSecret := tpl (default "" $secret.externalSecret) $global }}
{{- if not $externalSecret }}
---
- {{ include "common.secret._header" (dict "global" $global "name" $name) }}
+ {{ include "common.secret._header" (dict "global" $global "name" $name "annotations" $annotations) }}
{{- if eq $type "generic" }}
data: