Prevent start_for_complement.sh from setting START_POSTGRES to false when it's already set (#16985)

I have a use case where I'd like the Synapse image to start up a
postgres instance that I can use, but don't want to force Synapse to use
postgres as well.

This commit prevents postgres from being started when it has already
been explicitly enabled elsewhere.
This commit is contained in:
Andrew Morgan 2024-03-21 08:50:51 -05:00 committed by GitHub
parent cf5adc80e1
commit 21daa56ee1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 5 additions and 3 deletions

1
changelog.d/16985.misc Normal file
View file

@ -0,0 +1 @@
Allow containers building on top of Synapse's Complement container is use the included PostgreSQL cluster.

View file

@ -1,7 +1,7 @@
[program:postgres]
command=/usr/local/bin/prefix-log gosu postgres postgres
# Only start if START_POSTGRES=1
# Only start if START_POSTGRES=true
autostart=%(ENV_START_POSTGRES)s
# Lower priority number = starts first

View file

@ -32,8 +32,9 @@ case "$SYNAPSE_COMPLEMENT_DATABASE" in
;;
sqlite|"")
# Configure supervisord not to start Postgres, as we don't need it
export START_POSTGRES=false
# Set START_POSTGRES to false unless it has already been set
# (i.e. by another container image inheriting our own).
export START_POSTGRES=${START_POSTGRES:-false}
;;
*)