diff options
author | Marco Platania <platania@research.att.com> | 2019-05-07 14:55:00 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-05-07 14:55:00 +0000 |
commit | efe1bac85828cff233167bdaaae7edd26b03e7a4 (patch) | |
tree | 5c9cca5b20ab5fe3d82ae2f25b6a56c4abae2ce1 /vnfs/DAaaS/visualization/charts/grafana/templates/_helpers.tpl | |
parent | 2e3e9ce49761fa60e9605a5c4ac74c1509596029 (diff) | |
parent | 5b1cd4ca88dd979c4b538c41db53031706e8d31b (diff) |
Merge "Visualization Helm charts package"
Diffstat (limited to 'vnfs/DAaaS/visualization/charts/grafana/templates/_helpers.tpl')
-rwxr-xr-x | vnfs/DAaaS/visualization/charts/grafana/templates/_helpers.tpl | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/vnfs/DAaaS/visualization/charts/grafana/templates/_helpers.tpl b/vnfs/DAaaS/visualization/charts/grafana/templates/_helpers.tpl new file mode 100755 index 00000000..3a3ebd3e --- /dev/null +++ b/vnfs/DAaaS/visualization/charts/grafana/templates/_helpers.tpl @@ -0,0 +1,43 @@ +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "grafana.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "grafana.fullname" -}} +{{- if .Values.fullnameOverride -}} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- $name := default .Chart.Name .Values.nameOverride -}} +{{- if contains $name .Release.Name -}} +{{- .Release.Name | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} +{{- end -}} +{{- end -}} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "grafana.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Create the name of the service account +*/}} +{{- define "grafana.serviceAccountName" -}} +{{- if .Values.serviceAccount.create -}} + {{ default (include "grafana.fullname" .) .Values.serviceAccount.name }} +{{- else -}} + {{ default "default" .Values.serviceAccount.name }} +{{- end -}} +{{- end -}} |