Skip to content

Commit 0d30e68

Browse files
committed
allow RabbitMQ vhost
1 parent 2e2b043 commit 0d30e68

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

charts/invenio/templates/_helpers.tpl

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,16 @@
113113
{{- end }}
114114
{{- end -}}
115115

116+
########################## RabbitMQ vhost ##########################
117+
{{/*
118+
This template renders the vhost for RabbitMQ.
119+
*/}}
120+
{{- define "invenio.rabbitmq.vhost" -}}
121+
{{- if .Values.rabbitmq.enabled }}''{{- else }}
122+
{{- required "Missing .Values.rabbitmqExternal.vhost" .Values.rabbitmqExternal.vhost }}
123+
{{- end }}
124+
{{- end -}}
125+
116126
########################## Celery broker URI ##########################
117127
{{/*
118128
This template renders the URI for connecting to RabbitMQ.
@@ -123,7 +133,8 @@
123133
{{- $port := (include "invenio.rabbitmq.amqpPort" .) -}}
124134
{{- $hostname := (include "invenio.rabbitmq.hostname" .) -}}
125135
{{- $protocol := (include "invenio.rabbitmq.protocol" .) -}}
126-
{{- printf "%s://%s:%s@%s:%v/" $protocol $username $password $hostname $port }}
136+
{{- $vhost := (include "invenio.rabbitmq.vhost" .) -}}
137+
{{- printf "%s://%s:%s@%s:%v/%s" $protocol $username $password $hostname $port $vhost}}
127138
{{- end -}}
128139

129140
########################### RabbitMQ API URI ###########################

0 commit comments

Comments
 (0)