Scott Baker | afff308 | 2018-07-16 17:23:26 -0700 | [diff] [blame] | 1 | {{/* vim: set filetype=mustache: */}} |
| 2 | {{/* |
| 3 | Copyright 2018-present Open Networking Foundation |
| 4 | |
| 5 | Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | you may not use this file except in compliance with the License. |
| 7 | You may obtain a copy of the License at |
| 8 | |
| 9 | http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | |
| 11 | Unless required by applicable law or agreed to in writing, software |
| 12 | distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | See the License for the specific language governing permissions and |
| 15 | limitations under the License. |
| 16 | */}} |
| 17 | {{/* |
| 18 | Expand the name of the chart. |
| 19 | */}} |
Matteo Scandolo | 34dd236 | 2018-12-12 15:16:25 -0800 | [diff] [blame] | 20 | {{- define "seba-services.name" -}} |
Scott Baker | afff308 | 2018-07-16 17:23:26 -0700 | [diff] [blame] | 21 | {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} |
| 22 | {{- end -}} |
| 23 | |
| 24 | {{/* |
| 25 | Create a default fully qualified app name. |
| 26 | We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). |
| 27 | If release name contains chart name it will be used as a full name. |
| 28 | */}} |
Matteo Scandolo | 34dd236 | 2018-12-12 15:16:25 -0800 | [diff] [blame] | 29 | {{- define "seba-services.fullname" -}} |
Scott Baker | afff308 | 2018-07-16 17:23:26 -0700 | [diff] [blame] | 30 | {{- if .Values.fullnameOverride -}} |
| 31 | {{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} |
| 32 | {{- else -}} |
| 33 | {{- $name := default .Chart.Name .Values.nameOverride -}} |
| 34 | {{- if contains $name .Release.Name -}} |
| 35 | {{- .Release.Name | trunc 63 | trimSuffix "-" -}} |
| 36 | {{- else -}} |
| 37 | {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} |
| 38 | {{- end -}} |
| 39 | {{- end -}} |
| 40 | {{- end -}} |
| 41 | |
| 42 | {{/* |
| 43 | Create chart name and version as used by the chart label. |
| 44 | */}} |
Matteo Scandolo | 34dd236 | 2018-12-12 15:16:25 -0800 | [diff] [blame] | 45 | {{- define "seba-services.chart" -}} |
Scott Baker | afff308 | 2018-07-16 17:23:26 -0700 | [diff] [blame] | 46 | {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} |
| 47 | {{- end -}} |