blob: aeef6e9268e918412916fbb73107cf0901540b75 [file] [log] [blame]
SeanCondon3c3d08f2022-05-27 11:39:58 +01001{{/* vim: set filetype=mustache: */}}
2{{/*
3SPDX-FileCopyrightText: 2022-present Intel Corporation
4SPDX-License-Identifier: Apache-2.0
5
6Expand the name of the chart.
7*/}}
8{{- define "global.name" -}}
9{{- default .Chart.Name .Values.global.nameOverride | trunc 63 | trimSuffix "-" -}}
10{{- end -}}
11
12{{/*
13Create a default fully qualified app name.
14We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
15If release name contains chart name it will be used as a full name.
16*/}}
17{{- define "global.fullname" -}}
18{{- if .Values.global.fullnameOverride -}}
19{{- .Values.global.fullnameOverride | trunc 63 | trimSuffix "-" -}}
20{{- else -}}
21{{- $name := default .Chart.Name .Values.global.nameOverride -}}
22{{- if contains $name .Release.Name -}}
23{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
24{{- else -}}
25{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
26{{- end -}}
27{{- end -}}
28{{- end -}}
29
30{{/*
31Create chart name and version as used by the chart label.
32*/}}
33{{- define "global.chart" -}}
34{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
35{{- end -}}
36
37{{/*
38Common labels
39*/}}
40{{- define "global.labels" -}}
41helm.sh/chart: {{ include "global.chart" . }}
42{{ include "global.selectorLabels" . }}
43{{- if .Chart.AppVersion }}
44app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
45{{- end }}
46app.kubernetes.io/managed-by: {{ .Release.Service }}
47{{- end -}}
48
49{{/*
50Selector labels
51*/}}
52{{- define "global.selectorLabels" -}}
53app.kubernetes.io/name: {{ include "global.name" . }}
54app.kubernetes.io/instance: {{ .Release.Name }}
55{{- end -}}
56
57{{/*
58global consensus image name
59*/}}
60{{- define "global.store.consensus.imagename" -}}
61{{- if .Values.global.store.consensus.image.tag -}}
62{{- if .Values.global.store.consensus.image.registry -}}
63{{- printf "%s/" .Values.global.store.consensus.image.registry -}}
64{{- end -}}
65{{- printf "%s:" .Values.global.store.consensus.image.repository -}}
66{{- .Values.global.store.consensus.image.tag -}}
67{{- else -}}
68""
69{{- end -}}
70{{- end -}}
71
72{{/*
73global consensus store name
74*/}}
75{{- define "global.store.consensus.name" -}}
76{{- if .Values.global.store.consensus.name -}}
77{{- printf "%s" .Values.global.store.consensus.name -}}
78{{- else -}}
79{{- printf "%s-consensus-store" ( include "global.fullname" . ) -}}
80{{- end -}}
81{{- end -}}