diff options
author | Krzysztof Opasiak <k.opasiak@samsung.com> | 2020-12-09 19:23:25 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2020-12-09 19:23:25 +0000 |
commit | 4be59f3fdfb1b3630cef8b51a27a619da6d5374f (patch) | |
tree | ab65dd1929a6995ed53cb17d324e444ea7f81f10 /kubernetes | |
parent | 89ff46fe05fef7095a081c9927f6467b01f97ace (diff) | |
parent | 696d9e945482ae7b5cd748de2b65e0fa901cbdbd (diff) |
Merge "[COMMON] Enhancements on common templates"
Diffstat (limited to 'kubernetes')
-rw-r--r-- | kubernetes/common/common/templates/_labels.tpl | 17 | ||||
-rw-r--r-- | kubernetes/common/common/templates/_mariadb.tpl | 7 |
2 files changed, 16 insertions, 8 deletions
diff --git a/kubernetes/common/common/templates/_labels.tpl b/kubernetes/common/common/templates/_labels.tpl index 66727629ef..da8f00f3e4 100644 --- a/kubernetes/common/common/templates/_labels.tpl +++ b/kubernetes/common/common/templates/_labels.tpl @@ -30,7 +30,7 @@ app.kubernetes.io/instance: {{ include "common.release" $dot }} app.kubernetes.io/managed-by: {{ $dot.Release.Service }} {{ if .labels }} {{- include "common.tplValue" (dict "value" .labels "context" $dot) }} -{{- end -}} +{{- end }} {{- end -}} {{/* @@ -41,14 +41,15 @@ The function takes several arguments (inside a dictionary): */}} {{- define "common.matchLabels" -}} {{- $dot := default . .dot -}} -{{- if not .matchLabels.nameNoMatch -}} +{{- $matchLabels := default (dict) .matchLabels -}} +{{- if not $matchLabels.nameNoMatch -}} app.kubernetes.io/name: {{ include "common.name" $dot }} {{- end }} app.kubernetes.io/instance: {{ include "common.release" $dot }} -{{ if .matchLabels }} -{{$_ := unset .matchLabels "nameNoMatch"}} -{{- include "common.tplValue" (dict "value" .matchLabels "context" $dot) }} -{{- end -}} +{{- if $matchLabels }} +{{$_ := unset $matchLabels "nameNoMatch"}} +{{- include "common.tplValue" (dict "value" $matchLabels "context" $dot) }} +{{- end }} {{- end -}} {{/* @@ -69,7 +70,7 @@ namespace: {{ include "common.namespace" $dot }} labels: {{- include "common.labels" (dict "labels" $labels "dot" $dot ) | nindent 2 }} {{- if $annotations }} annotations: {{- include "common.tplValue" (dict "value" $annotations "context" $dot) | nindent 2}} -{{- end -}} +{{- end }} {{- end -}} {{/* @@ -94,7 +95,7 @@ matchLabels: {{- include "common.matchLabels" (dict "matchLabels" $matchLabels " {{- $dot := default . .dot -}} {{- $labels := default (dict) .labels -}} {{- if $dot.Values.podAnnotations }} -annotations: {{- include "common.tplValue" (dict "value" $dot.Values.podAnnotations "context" $) | nindent 2 }} +annotations: {{- include "common.tplValue" (dict "value" $dot.Values.podAnnotations "context" $dot) | nindent 2 }} {{- end }} labels: {{- include "common.labels" (dict "labels" $labels "dot" $dot) | nindent 2 }} name: {{ include "common.name" $dot }} diff --git a/kubernetes/common/common/templates/_mariadb.tpl b/kubernetes/common/common/templates/_mariadb.tpl index df0e6b41c9..1be3e3b790 100644 --- a/kubernetes/common/common/templates/_mariadb.tpl +++ b/kubernetes/common/common/templates/_mariadb.tpl @@ -45,6 +45,13 @@ {{- end -}} {{/* + UID of mariadb backup credentials +*/}} +{{- define "common.mariadb.secret.backupCredentialsUID" -}} + {{- printf "db-backup-credentials" }} +{{- end -}} + +{{/* Name of mariadb user credentials secret */}} {{- define "common.mariadb.secret.userCredentialsSecretName" -}} |