Skip to content
This repository was archived by the owner on Mar 17, 2020. It is now read-only.

Commit 9124f29

Browse files
authored
fix(AAE-1223): Removed Postgres init container (#295)
* fix: Removed Postgres init container * fix: Externalized RabbitMq name and port via tpl * fix(chart): Corrected extraEnv formatting * fix(chart): unexpected "(" in operand * fix(chart): remove whitespace in tpl
1 parent 83d19f3 commit 9124f29

File tree

3 files changed

+18
-22
lines changed

3 files changed

+18
-22
lines changed

charts/activiti-cloud-notifications-graphql/templates/_helpers.tpl

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,15 @@ Create a default service name.
2828
{{- end -}}
2929

3030

31-
{{- define "notifications.rabbitmq-name" -}}
32-
{{- if .Values.global.rabbitmq.host.value }}
33-
{{ .Values.global.rabbitmq.host.value }}
34-
{{- else }}
35-
{{- printf "%s-%s" .Release.Name (.Values.rabbitmq.name | default "rabbitmq") -}}
36-
{{- end }}
31+
{{- define "activiti.notifications.rabbitmq-name" -}}
32+
{{- if .Values.global.rabbitmq.host.value -}}
33+
{{ tpl .Values.global.rabbitmq.host.value . }}
34+
{{- else -}}
35+
{{ tpl .Values.rabbitmq.name . }}
36+
{{- end -}}
37+
{{- end -}}
38+
39+
{{- define "activiti.notifications.rabbitmq-port" -}}
40+
{{ tpl (toString .Values.rabbitmq.port) . }}
3741
{{- end -}}
3842

charts/activiti-cloud-notifications-graphql/templates/deployment.yaml

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,20 @@ spec:
44
template:
55
spec:
66
initContainers:
7-
{{- if .Values.postgres.enabled }}
8-
- name: wait-for-postgresql
9-
image: {{ .Values.init.container.image | quote }}
10-
imagePullPolicy: {{ .Values.init.container.imagePullPolicy }}
11-
command:
12-
- sh
13-
- -c
14-
- |
15-
until printf "." && nc -z -w 2 {{ .Release.Name }}-{{ .Values.postgres.name }} {{ .Values.postgres.port }}; do
16-
sleep 2;
17-
done;
18-
echo 'PostgreSQL OK ✓'
19-
{{- end }}
207
{{- if .Values.rabbitmq.enabled }}
218
- name: wait-for-rabbitmq
229
image: {{ .Values.init.container.image | quote }}
2310
imagePullPolicy: {{ .Values.init.container.imagePullPolicy }}
11+
env:
12+
- name: RABBITMQ_HOST
13+
value: {{ include "activiti.notifications.rabbitmq-name" . | quote }}
14+
- name: RABBITMQ_PORT
15+
value: {{ include "activiti.notifications.rabbitmq-port" . | quote }}
2416
command:
2517
- sh
2618
- -c
2719
- |
28-
until printf "." && nc -z -w 2 {{ include "notifications.rabbitmq-name" . }} {{ .Values.rabbitmq.port | default 5672 }}; do
20+
until printf "." && nc -z -w 2 $RABBITMQ_HOST $RABBITMQ_PORT; do
2921
sleep 2;
3022
done;
3123
echo 'RabbitMq OK ✓'

charts/activiti-cloud-notifications-graphql/values.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ postgres:
4242

4343
rabbitmq:
4444
enabled: true
45-
name: "rabbitmq"
45+
name: "{{ .Release.Name }}-rabbitmq"
4646
port: 5672
4747

4848
javaOpts:
@@ -55,7 +55,7 @@ extraEnv: |
5555
{{- if include "common.ingress-path" . }}
5656
- name: SERVER_SERVLET_CONTEXTPATH
5757
value: {{ include "common.ingress-path" . | quote }}
58-
{{- end }}
58+
{{- end }}
5959
# - name: ACT_KEYCLOAK_URL
6060
# valueFrom:
6161
# configMapKeyRef:

0 commit comments

Comments
 (0)