Add external service endpoints
[it/dep.git] / ric-platform / 55-Ext-Services / helm / ext / templates / _helper.tpl
1 ################################################################################
2 #   Copyright (c) 2019 AT&T Intellectual Property.                             #
3 #   Copyright (c) 2019 Nokia.                                                  #
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 {{/* vim: set filetype=mustache: */}}
19 {{/*
20 Expand the name of the chart.
21 */}}
22 {{- define "ext.name" -}}
23 {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
24 {{- end -}}
25
26 {{/*
27 Create a default fully qualified app name.
28 We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec)
29 .
30 If release name contains chart name it will be used as a full name.
31 */}}
32 {{- define "ext.fullname" -}}
33 {{- if .Values.fullnameOverride -}}
34 {{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
35 {{- else -}}
36 {{- $name := default .Chart.Name .Values.nameOverride -}}
37 {{- if contains $name .Release.Name -}}
38 {{- .Release.Name | trunc 63 | trimSuffix "-" -}}
39 {{- else -}}
40 {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
41 {{- end -}}
42 {{- end -}}
43 {{- end -}}
44
45 {{/*
46 Create chart name and version as used by the chart label.
47 */}}
48 {{- define "ext.chart" -}}
49 {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
50 {{- end -}}
51