diff --git a/upstreamed/rabbitmq/Chart.yaml b/upstreamed/rabbitmq/Chart.yaml index 7b8124a72..c20d6458d 100644 --- a/upstreamed/rabbitmq/Chart.yaml +++ b/upstreamed/rabbitmq/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 name: rabbitmq -version: 6.14.0 +version: 6.14.1 appVersion: 3.8.2 description: Open source message broker software that implements the Advanced Message Queuing Protocol (AMQP) keywords: diff --git a/upstreamed/rabbitmq/ci/affinity-toleration-values.yaml b/upstreamed/rabbitmq/ci/affinity-toleration-values.yaml new file mode 100644 index 000000000..6be0ee1d3 --- /dev/null +++ b/upstreamed/rabbitmq/ci/affinity-toleration-values.yaml @@ -0,0 +1,14 @@ +tolerations: + - key: foo + operator: "Equal" + value: bar +affinity: + nodeAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - weight: 100 + preference: + matchExpressions: + - key: foo + operator: In + values: + - bar diff --git a/upstreamed/rabbitmq/templates/_helpers.tpl b/upstreamed/rabbitmq/templates/_helpers.tpl index 267a33a3b..3ed01cd3a 100644 --- a/upstreamed/rabbitmq/templates/_helpers.tpl +++ b/upstreamed/rabbitmq/templates/_helpers.tpl @@ -243,3 +243,16 @@ rabbitmq: LDAP {{- end -}} {{- end -}} {{- end -}} + +{{/* +Renders a value that contains template. +Usage: +{{ include "rabbitmq.tplValue" (dict "value" .Values.path.to.the.Value "context" $) }} +*/}} +{{- define "rabbitmq.tplValue" -}} + {{- if typeIs "string" .value }} + {{- tpl .value .context }} + {{- else }} + {{- tpl (.value | toYaml) .context }} + {{- end }} +{{- end -}} diff --git a/upstreamed/rabbitmq/templates/statefulset.yaml b/upstreamed/rabbitmq/templates/statefulset.yaml index 9dab6f089..f021cf70b 100644 --- a/upstreamed/rabbitmq/templates/statefulset.yaml +++ b/upstreamed/rabbitmq/templates/statefulset.yaml @@ -41,12 +41,9 @@ spec: {{- if .Values.rbacEnabled}} serviceAccountName: {{ template "rabbitmq.fullname" . }} {{- end }} - affinity: -{{- if .Values.affinity }} - {{- with .Values.affinity }} -{{ tpl . $ | indent 8 }} - {{- end }} -{{- end }} + {{- if .Values.affinity }} + affinity: {{- include "rabbitmq.tplValue" (dict "value" .Values.affinity "context" .) | nindent 8 }} + {{- end }} {{- if .Values.priorityClassName }} priorityClassName: {{ .Values.priorityClassName }} {{- end }}