blob: ef34f5a1f8757f16a0e9585801ea33e05270858a [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 -}}
Ray Milkeycd9f8d12022-08-09 12:27:09 -070058
59{{/*
60fabric-adapter consensus image name
61*/}}
62{{- define "fabric-adapter.store.consensus.imagename" -}}
63{{- if or .Values.store.consensus.image.tag .Values.global.store.consensus.image.tag -}}
64{{- if .Values.global.store.consensus.image.registry -}}
65{{- printf "%s/" .Values.global.store.consensus.image.registry -}}
66{{- else if .Values.store.consensus.image.registry -}}
67{{- printf "%s/" .Values.store.consensus.image.registry -}}
68{{- end -}}
69{{- printf "%s:" .Values.store.consensus.image.repository -}}
70{{- if .Values.global.store.consensus.image.tag -}}
71{{- .Values.global.store.consensus.image.tag -}}
72{{- else -}}
73{{- .Values.store.consensus.image.tag -}}
74{{- end -}}
75{{- else -}}
76""
77{{- end -}}
78{{- end -}}
79
80{{/*
81fabric-adapter consensus store name
82*/}}
83{{- define "fabric-adapter.store.consensus.name" -}}
84{{- if .Values.store.consensus.name -}}
85{{- printf "%s" .Values.store.consensus.name -}}
86{{- else -}}
87{{- printf "%s-consensus-store" ( include "fabric-adapter.fullname" . ) -}}
88{{- end -}}
89{{- end -}}