Scott Baker | 6965439 | 2021-09-17 13:50:16 -0700 | [diff] [blame] | 1 | {{/* vim: set filetype=mustache: */}} |
| 2 | {{/* |
| 3 | SPDX-FileCopyrightText: 2020-present Open Networking Foundation <info@opennetworking.org> |
Sean Condon | 160ec1d | 2022-02-08 12:58:25 +0000 | [diff] [blame] | 4 | SPDX-License-Identifier: Apache-2.0 |
Scott Baker | 6965439 | 2021-09-17 13:50:16 -0700 | [diff] [blame] | 5 | |
| 6 | Expand the name of the chart. |
| 7 | */}} |
| 8 | {{- define "global.name" -}} |
| 9 | {{- default .Chart.Name .Values.global.nameOverride | trunc 63 | trimSuffix "-" -}} |
| 10 | {{- end -}} |
| 11 | |
| 12 | {{/* |
| 13 | Create a default fully qualified app name. |
| 14 | We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). |
| 15 | If 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 | {{/* |
| 31 | Create 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 | {{/* |
| 38 | Common labels |
| 39 | */}} |
| 40 | {{- define "global.labels" -}} |
| 41 | helm.sh/chart: {{ include "global.chart" . }} |
| 42 | {{ include "global.selectorLabels" . }} |
| 43 | {{- if .Chart.AppVersion }} |
| 44 | app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} |
| 45 | {{- end }} |
| 46 | app.kubernetes.io/managed-by: {{ .Release.Service }} |
| 47 | {{- end -}} |
| 48 | |
| 49 | {{/* |
| 50 | Selector labels |
| 51 | */}} |
| 52 | {{- define "global.selectorLabels" -}} |
| 53 | app.kubernetes.io/name: {{ include "global.name" . }} |
| 54 | app.kubernetes.io/instance: {{ .Release.Name }} |
| 55 | {{- end -}} |
| 56 | |
| 57 | {{/* |
| 58 | global consensus image name |
| 59 | */}} |
SeanCondon | 4346ab9 | 2022-11-30 13:33:08 +0000 | [diff] [blame] | 60 | {{- define "global.atomix.store.consensus.imagename" -}} |
| 61 | {{- if .Values.global.atomix.store.consensus.image.tag -}} |
| 62 | {{- if .Values.global.atomix.store.consensus.image.registry -}} |
| 63 | {{- printf "%s/" .Values.global.atomix.store.consensus.image.registry -}} |
Scott Baker | 6965439 | 2021-09-17 13:50:16 -0700 | [diff] [blame] | 64 | {{- end -}} |
SeanCondon | 4346ab9 | 2022-11-30 13:33:08 +0000 | [diff] [blame] | 65 | {{- printf "%s:" .Values.global.atomix.store.consensus.image.repository -}} |
| 66 | {{- .Values.global.atomix.store.consensus.image.tag -}} |
Scott Baker | 6965439 | 2021-09-17 13:50:16 -0700 | [diff] [blame] | 67 | {{- else -}} |
| 68 | "" |
| 69 | {{- end -}} |
| 70 | {{- end -}} |
| 71 | |
| 72 | {{/* |
| 73 | global consensus store name |
| 74 | */}} |
SeanCondon | 4346ab9 | 2022-11-30 13:33:08 +0000 | [diff] [blame] | 75 | {{- define "global.atomix.store.consensus.name" -}} |
| 76 | {{- if .Values.global.atomix.store.consensus.name -}} |
| 77 | {{- printf "%s" .Values.global.atomix.store.consensus.name -}} |
Scott Baker | 6965439 | 2021-09-17 13:50:16 -0700 | [diff] [blame] | 78 | {{- else -}} |
| 79 | {{- printf "%s-consensus-store" ( include "global.fullname" . ) -}} |
| 80 | {{- end -}} |
SeanCondon | 9a99c26 | 2023-01-09 17:20:49 +0000 | [diff] [blame] | 81 | {{- end -}} |
| 82 | |
| 83 | {{/* |
| 84 | sdcore-test-dummy |
| 85 | */}} |
| 86 | {{- define "sdcore-test-dummy.fullname" -}} |
| 87 | {{- printf "%s-sdcore-test-dummy" .Release.Name -}} |
| 88 | {{- end -}} |
| 89 | |
| 90 | {{/* |
| 91 | sdcore-adapter-v2-0-addr |
| 92 | */}} |
| 93 | {{- define "sdcore-adapter-v2-0-addr" -}} |
| 94 | {{- printf "%s-sdcore-adapter-v2-0:5150" .Release.Name -}} |
| 95 | {{- end -}} |
| 96 | |
| 97 | {{/* |
| 98 | sdcore-adapter-v2-1-addr |
| 99 | */}} |
| 100 | {{- define "sdcore-adapter-v2-1-addr" -}} |
| 101 | {{- printf "%s-sdcore-adapter-v2-1:5150" .Release.Name -}} |
| 102 | {{- end -}} |