Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -456,15 +456,15 @@ var _ = Describe("Integration tests for the Synapse controller", Ordered, Label(
By("Checking that a Synapse Deployment exists and is correctly configured")
checkResourcePresence(createdDeployment, synapseLookupKey, expectedOwnerReference)

By("Checking that initContainers contains the required environment variables")
By("Checking that initContainer for generating config file contains the required environment variables")
envVars := []corev1.EnvVar{{
Name: "SYNAPSE_SERVER_NAME",
Value: ServerName,
}, {
Name: "SYNAPSE_REPORT_STATS",
Value: utils.BoolToYesNo(ReportStats),
}}
Expect(createdDeployment.Spec.Template.Spec.InitContainers[0].Env).Should(ContainElements(envVars))
Expect(createdDeployment.Spec.Template.Spec.InitContainers[1].Env).Should(ContainElements(envVars))
})

It("Should create a Synapse Service", func() {
Expand Down Expand Up @@ -557,15 +557,15 @@ var _ = Describe("Integration tests for the Synapse controller", Ordered, Label(
By("Checking that a Synapse Deployment exists and is correctly configured")
checkResourcePresence(createdDeployment, synapseLookupKey, expectedOwnerReference)

By("Checking that initContainers contains the required environment variables")
By("Checking that initContainer for generating config file contains the required environment variables")
envVars := []corev1.EnvVar{{
Name: "SYNAPSE_SERVER_NAME",
Value: ServerName,
}, {
Name: "SYNAPSE_REPORT_STATS",
Value: utils.BoolToYesNo(ReportStats),
}}
Expect(createdDeployment.Spec.Template.Spec.InitContainers[0].Env).Should(ContainElements(envVars))
Expect(createdDeployment.Spec.Template.Spec.InitContainers[1].Env).Should(ContainElements(envVars))
})

It("Should create a Synapse Service", func() {
Expand Down
20 changes: 16 additions & 4 deletions internal/templates/synapse_deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,31 @@ spec:
serviceAccountName: {{ .Values.Name }}
{{- end }}
initContainers:
# Copy homeserver.yaml from read-only ConfigMap to writable PV
# This allows manual editing of the configuration
- image: registry.access.redhat.com/ubi8/ubi-minimal:8.10
name: "copy-homeserver-config"
args:
- if [ ! -f /data/homeserver.yaml ]; then cp /data-homeserver/homeserver.yaml /data/homeserver.yaml; fi
command:
- bin/sh
- -c
volumeMounts:
- name: homeserver
mountPath: /data-homeserver
- name: data-pv
mountPath: /data
- image: "matrixdotorg/synapse:v1.133.0"
name: "synapse-generate"
args: [ "generate" ]
env:
- name: SYNAPSE_CONFIG_PATH
value: /data-homeserver/homeserver.yaml
value: /data/homeserver.yaml
- name: SYNAPSE_SERVER_NAME
value: {{ .Values.Status.HomeserverConfiguration.ServerName }}
- name: SYNAPSE_REPORT_STATS
value: {{ if .Values.Status.HomeserverConfiguration.ReportStats }}"yes"{{ else }}"no"{{ end }}
volumeMounts:
- name: homeserver
mountPath: /data-homeserver
- name: data-pv
mountPath: /data
{{ if .Values.Status.Bridges.MautrixSignal.Enabled -}}
Expand All @@ -53,7 +65,7 @@ spec:
name: "synapse"
env:
- name: SYNAPSE_CONFIG_PATH
value: /data-homeserver/homeserver.yaml
value: /data/homeserver.yaml
volumeMounts:
- name: homeserver
mountPath: /data-homeserver
Expand Down