Mohammed Naser | 9ad0d46 | 2023-01-15 20:36:37 -0500 | [diff] [blame] | 1 | {{/* |
Mohammed Naser | 7d1623e | 2024-06-17 09:12:39 -0400 | [diff] [blame] | 2 | Copyright Broadcom, Inc. All Rights Reserved. |
Mohammed Naser | 65cda13 | 2024-05-02 14:34:08 -0400 | [diff] [blame] | 3 | SPDX-License-Identifier: APACHE-2.0 |
| 4 | */}} |
| 5 | |
| 6 | {{/* |
Mohammed Naser | 9ad0d46 | 2023-01-15 20:36:37 -0500 | [diff] [blame] | 7 | Return the proper RabbitMQ Cluster Operator fullname |
| 8 | Note: We use the regular common function as the chart name already contains the |
| 9 | the rabbitmq-cluster-operator name. |
| 10 | */}} |
| 11 | {{- define "rmqco.clusterOperator.fullname" -}} |
| 12 | {{- include "common.names.fullname" . -}} |
| 13 | {{- end -}} |
| 14 | |
| 15 | {{/* |
| 16 | Return the proper RabbitMQ Messaging Topology Operator fullname |
| 17 | NOTE: Not using the common function to avoid generating too long names |
| 18 | */}} |
| 19 | {{- define "rmqco.msgTopologyOperator.fullname" -}} |
| 20 | {{- if .Values.msgTopologyOperator.fullnameOverride -}} |
Mohammed Naser | 65cda13 | 2024-05-02 14:34:08 -0400 | [diff] [blame] | 21 | {{- printf "%s" .Values.msgTopologyOperator.fullnameOverride | trunc 63 | trimSuffix "-" -}} |
Mohammed Naser | 9ad0d46 | 2023-01-15 20:36:37 -0500 | [diff] [blame] | 22 | {{- 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 Naser | 65cda13 | 2024-05-02 14:34:08 -0400 | [diff] [blame] | 30 | Return 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 Naser | 9ad0d46 | 2023-01-15 20:36:37 -0500 | [diff] [blame] | 37 | Return the proper RabbitMQ Messaging Topology Operator fullname |
| 38 | NOTE: 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 Naser | 65cda13 | 2024-05-02 14:34:08 -0400 | [diff] [blame] | 51 | Return 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 Naser | 9ad0d46 | 2023-01-15 20:36:37 -0500 | [diff] [blame] | 58 | Return 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 | {{/* |
| 69 | Return 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 | {{/* |
| 76 | Return 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 | {{/* |
| 83 | Return 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 | {{/* |
| 90 | Return 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 | {{/* |
| 97 | Return 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 | {{/* |
| 104 | Return 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 | {{/* |
| 124 | Create 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 | {{/* |
| 135 | Create 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 -}} |