Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify host variable usage and exit early when one is not set #2075

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

rmelotte
Copy link

  • clarify the usage of MYSQL_HOST and POSTGRES_HOST in the README.
  • exit early if the DB host variable is missing.

The auto configuration sections seems to imply that POSTGRES_HOST and
MYSQL_HOST can be file variables, while this is not supported. If all
variables are set as files including the host, the installation will
not be done automatically.
This can be hard to figure out, as during the first start of the
container nothing indicates why the auto configuration is not done.

To try to make it a bit clearer in the README, explicitly mention that
using a file for the hosts variable is not supported.

Furthermore, in the docker secrets section it's currently easy to
misread the fact that the last variable mentioned (the host) is not
using '_FILE'. Since it's anyway not part of the group of variables
that support secrets, remove it from the list to avoid confusion.

Signed-off-by: Raphaël Mélotte <raphael.melotte@mind.be>
Since all DB variables but the host can be set using secrets (by
appending '_FILE' to the variable name), it can be easy for a user to
mis-configure their DB host variable by storing them in
MYSQL_HOST_FILE or POSTGRESQL_HOST_FILE (which is not supported).
When that happens, the auto configuration is skipped.
Such a situation is a bit cumbersome to figure out as nothing
indicates why the auto configuration is skipped.
To make to make it obvious to the user, exit early if DB variables
have been set (using secrets or not), but the host has not been
set (for example, because it was set in MYSQL_HOST_FILE).

Signed-off-by: Raphaël Mélotte <raphael.melotte@mind.be>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants