X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=helm-manager%2Fcharts%2Ftemplates%2F_helpers.tpl;fp=helm-manager%2Fcharts%2Ftemplates%2F_helpers.tpl;h=59a4ef20f0740b0b065b7b7885f1bcbcf8218471;hb=90f14b967777a7a78a1200e748377a64503bbfd9;hp=0000000000000000000000000000000000000000;hpb=0e96b9e7209c06f6e3ce090a737f0c504f5a0948;p=nonrtric.git diff --git a/helm-manager/charts/templates/_helpers.tpl b/helm-manager/charts/templates/_helpers.tpl new file mode 100644 index 00000000..59a4ef20 --- /dev/null +++ b/helm-manager/charts/templates/_helpers.tpl @@ -0,0 +1,50 @@ +################################################################################ +# Copyright (c) 2021 Nordix Foundation. # +# # +# Licensed under the Apache License, Version 2.0 (the "License"); # +# you may not use this file except in compliance with the License. # +# You may obtain a copy of the License at # +# # +# http://www.apache.org/licenses/LICENSE-2.0 # +# # +# Unless required by applicable law or agreed to in writing, software # +# distributed under the License is distributed on an "AS IS" BASIS, # +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # +# See the License for the specific language governing permissions and # +# limitations under the License. # +################################################################################ + +{{/* +Create a default fully qualified app name. +Truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +*/}} + +{{- define "helmmanager.fullname" -}} +{{- $name := default .Chart.Name .Values.nameOverride -}} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{- define "helmmanager.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{- define "helmmanager.namespace" -}} +{{- default .Release.Namespace .Values.namespace -}} +{{- end -}} + +{{- define "helmmanager.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{- define "helmmanager.labels" -}} +app.kubernetes.io/name: {{ template "helmmanager.name" . }} +helm.sh/chart: {{ template "helmmanager.chart" . }} +app.kubernetes.io/instance: "{{ .Release.Name }}" +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end -}} + +{{- define "helmmanager.selectorLabels" -}} +app.kubernetes.io/name: {{ template "helmmanager.name" . }} +app.kubernetes.io/component: app +app.kubernetes.io/instance: "{{ .Release.Name }}" +{{- end -}} \ No newline at end of file