blob: 78785946c15c3cfdf36caf17392ee48f1b7d93d6 [file] [log] [blame]
Scott Bakere3090f02022-05-31 15:51:41 -07001{{/* vim: set filetype=mustache: */}}
2{{/*
3SPDX-FileCopyrightText: 2022-present Intel Corporation
4SPDX-FileCopyrightText: 2020-present Open Networking Foundation <info@opennetworking.org>
5SPDX-License-Identifier: Apache-2.0
6
7Expand the name of the chart.
8*/}}
9{{- define "fabric-adapter.name" -}}
10{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
11{{- end -}}
12
13{{/*
14Create a default fully qualified app name.
15We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
16If release name contains chart name it will be used as a full name.
17*/}}
18{{- define "fabric-adapter.fullname" -}}
19{{- if .Values.fullnameOverride -}}
20{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
21{{- else -}}
22{{- $name := default .Chart.Name .Values.nameOverride -}}
23{{- if contains $name .Release.Name -}}
24{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
25{{- else -}}
26{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
27{{- end -}}
28{{- end -}}
29{{- end -}}
30
31{{/*
32Create chart name and version as used by the chart label.
33*/}}
34{{- define "fabric-adapter.chart" -}}
35{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
36{{- end -}}
37
38
39{{/*
40Common labels
41*/}}
42{{- define "fabric-adapter.labels" -}}
43helm.sh/chart: {{ include "fabric-adapter.chart" . }}
44{{ include "fabric-adapter.selectorLabels" . }}
45{{- if .Chart.AppVersion }}
46app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
47{{- end }}
48app.kubernetes.io/managed-by: {{ .Release.Service }}
49{{- end -}}
50
51{{/*
52Selector labels
53*/}}
54{{- define "fabric-adapter.selectorLabels" -}}
55app.kubernetes.io/name: {{ include "fabric-adapter.name" . }}
56app.kubernetes.io/instance: {{ .Release.Name }}
57{{- end -}}