blob: 799b0baf655bd5eb2ed5d4c951d4896c368a64f1 [file] [log] [blame]
Mohammed Naser9ad0d462023-01-15 20:36:37 -05001{{/*
Mohammed Naser7d1623e2024-06-17 09:12:39 -04002Copyright Broadcom, Inc. All Rights Reserved.
Mohammed Naser65cda132024-05-02 14:34:08 -04003SPDX-License-Identifier: APACHE-2.0
4*/}}
5
6{{/*
Mohammed Naser9ad0d462023-01-15 20:36:37 -05007Return the proper RabbitMQ Cluster Operator fullname
8Note: We use the regular common function as the chart name already contains the
9the rabbitmq-cluster-operator name.
10*/}}
11{{- define "rmqco.clusterOperator.fullname" -}}
12{{- include "common.names.fullname" . -}}
13{{- end -}}
14
15{{/*
16Return the proper RabbitMQ Messaging Topology Operator fullname
17NOTE: Not using the common function to avoid generating too long names
18*/}}
19{{- define "rmqco.msgTopologyOperator.fullname" -}}
20{{- if .Values.msgTopologyOperator.fullnameOverride -}}
Mohammed Naser65cda132024-05-02 14:34:08 -040021 {{- printf "%s" .Values.msgTopologyOperator.fullnameOverride | trunc 63 | trimSuffix "-" -}}
Mohammed Naser9ad0d462023-01-15 20:36:37 -050022{{- else if .Values.fullnameOverride -}}
23 {{- printf "%s-%s" .Values.fullnameOverride "messaging-topology-operator" | trunc 63 | trimSuffix "-" -}}
24{{- else -}}
25 {{- printf "%s-%s" .Release.Name "rabbitmq-messaging-topology-operator" | trunc 63 | trimSuffix "-" -}}
26{{- end -}}
27{{- end -}}
28
29{{/*
Mohammed Naser65cda132024-05-02 14:34:08 -040030Return the proper RabbitMQ Messaging Topology Operator fullname adding the installation's namespace.
31*/}}
32{{- define "rmqco.msgTopologyOperator.fullname.namespace" -}}
33{{- printf "%s-%s" (include "rmqco.msgTopologyOperator.fullname" .) (include "common.names.namespace" .) | trunc 63 | trimSuffix "-" -}}
34{{- end -}}
35
36{{/*
Mohammed Naser9ad0d462023-01-15 20:36:37 -050037Return the proper RabbitMQ Messaging Topology Operator fullname
38NOTE: Not using the common function to avoid generating too long names
39*/}}
40{{- define "rmqco.msgTopologyOperator.webhook.fullname" -}}
41{{- if .Values.msgTopologyOperator.fullnameOverride -}}
42 {{- printf "%s-%s" .Values.msgTopologyOperator.fullnameOverride "webhook" | trunc 63 | trimSuffix "-" -}}
43{{- else if .Values.fullnameOverride -}}
44 {{- printf "%s-%s" .Values.fullnameOverride "messaging-topology-operator-webhook" | trunc 63 | trimSuffix "-" -}}
45{{- else -}}
46 {{- printf "%s-%s" .Release.Name "rabbitmq-messaging-topology-operator-webhook" | trunc 63 | trimSuffix "-" -}}
47{{- end -}}
48{{- end -}}
49
50{{/*
Mohammed Naser65cda132024-05-02 14:34:08 -040051Return the proper RabbitMQ Messaging Topology Operator fullname adding the installation's namespace.
52*/}}
53{{- define "rmqco.msgTopologyOperator.webhook.fullname.namespace" -}}
54{{- printf "%s-%s" (include "rmqco.msgTopologyOperator.webhook.fullname" .) (include "common.names.namespace" .) | trunc 63 | trimSuffix "-" -}}
55{{- end -}}
56
57{{/*
Mohammed Naser9ad0d462023-01-15 20:36:37 -050058Return the proper RabbitMQ Messaging Topology Operator fullname
59*/}}
60{{- define "rmqco.msgTopologyOperator.webhook.secretName" -}}
61{{- if .Values.msgTopologyOperator.existingWebhookCertSecret -}}
62 {{- .Values.msgTopologyOperator.existingWebhookCertSecret -}}
63{{- else }}
64 {{- include "rmqco.msgTopologyOperator.webhook.fullname" . -}}
65{{- end -}}
66{{- end -}}
67
68{{/*
69Return the proper RabbitMQ Default User Credential updater image name
70*/}}
71{{- define "rmqco.defaultCredentialUpdater.image" -}}
72{{ include "common.images.image" (dict "imageRoot" .Values.credentialUpdaterImage "global" .Values.global) }}
73{{- end -}}
74
75{{/*
76Return the proper RabbitMQ Cluster Operator image name
77*/}}
78{{- define "rmqco.clusterOperator.image" -}}
79{{ include "common.images.image" (dict "imageRoot" .Values.clusterOperator.image "global" .Values.global) }}
80{{- end -}}
81
82{{/*
83Return the proper RabbitMQ Cluster Operator image name
84*/}}
85{{- define "rmqco.msgTopologyOperator.image" -}}
86{{ include "common.images.image" (dict "imageRoot" .Values.msgTopologyOperator.image "global" .Values.global) }}
87{{- end -}}
88
89{{/*
90Return the proper RabbitMQ image name
91*/}}
92{{- define "rmqco.rabbitmq.image" -}}
93{{- include "common.images.image" ( dict "imageRoot" .Values.rabbitmqImage "global" .Values.global ) -}}
94{{- end -}}
95
96{{/*
97Return the proper Docker Image Registry Secret Names
98*/}}
99{{- define "rmqco.imagePullSecrets" -}}
100{{- include "common.images.pullSecrets" (dict "images" (list .Values.clusterOperator.image .Values.rabbitmqImage) "global" .Values.global) -}}
101{{- end -}}
102
103{{/*
104Return the proper Docker Image Registry Secret Names as a comma separated string
105*/}}
106{{- define "rmqco.imagePullSecrets.string" -}}
107{{- $pullSecrets := list }}
108{{- if .Values.global }}
109 {{- range .Values.global.imagePullSecrets -}}
110 {{- $pullSecrets = append $pullSecrets . -}}
111 {{- end -}}
112{{- end -}}
113{{- range (list .Values.clusterOperator.image .Values.rabbitmqImage) -}}
114 {{- range .pullSecrets -}}
115 {{- $pullSecrets = append $pullSecrets . -}}
116 {{- end -}}
117{{- end -}}
118{{- if (not (empty $pullSecrets)) }}
119 {{- printf "%s" (join "," $pullSecrets) -}}
120{{- end }}
121{{- end }}
122
123{{/*
124Create the name of the service account to use (Cluster Operator)
125*/}}
126{{- define "rmqco.clusterOperator.serviceAccountName" -}}
127{{- if .Values.clusterOperator.serviceAccount.create -}}
128 {{ default (printf "%s" (include "rmqco.clusterOperator.fullname" .)) .Values.clusterOperator.serviceAccount.name }}
129{{- else -}}
130 {{ default "default" .Values.clusterOperator.serviceAccount.name }}
131{{- end -}}
132{{- end -}}
133
134{{/*
135Create the name of the service account to use (Messaging Topology Operator)
136*/}}
137{{- define "rmqco.msgTopologyOperator.serviceAccountName" -}}
138{{- if .Values.msgTopologyOperator.serviceAccount.create -}}
139 {{ default (printf "%s" (include "rmqco.msgTopologyOperator.fullname" .)) .Values.msgTopologyOperator.serviceAccount.name }}
140{{- else -}}
141 {{ default "default" .Values.msgTopologyOperator.serviceAccount.name }}
142{{- end -}}
143{{- end -}}