X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=starlingx%2Fdemo%2Ffirewall-host-netdevice%2Ftemplates%2F_helpers.tpl;fp=starlingx%2Fdemo%2Ffirewall-host-netdevice%2Ftemplates%2F_helpers.tpl;h=7593e77929f66b7208f15317dbc705ad4782b213;hb=0a13e91612de5fa590bdecb7b17ef79e7f220131;hp=0000000000000000000000000000000000000000;hpb=bea5027a7f59bffee2a6ed931e63c05a9fb1bdc7;p=multicloud%2Fk8s.git diff --git a/starlingx/demo/firewall-host-netdevice/templates/_helpers.tpl b/starlingx/demo/firewall-host-netdevice/templates/_helpers.tpl new file mode 100644 index 00000000..7593e779 --- /dev/null +++ b/starlingx/demo/firewall-host-netdevice/templates/_helpers.tpl @@ -0,0 +1,32 @@ +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "firewall.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 "firewall.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 "firewall.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} +{{- end -}}