Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello there :)
When using external MongoDB, this docker image allow defining a mongodb connection string using the variable
EAP_MONGOD_URI
with the credentials inside as followsmongodb://root:whatever@your-ip-here/omada
. This is working fine.But in Kubernetes, the environment variables are usually loaded from a ConfigMap, and this type of manifests are commonly stored on git. However credentials are usually stored on a Secret resource, provisioned dynamically by a different flow.
As this image is not having different environment variables to define MongoDB user or password, we need a way to get them from another environment variables and put the content into the string. Some examples:
mongodb://root:$MONGODB_ROOT_PASSWORD@$MONGO_HOST/omada
mongodb://root:${MONGODB_ROOT_PASSWORD}@${MONGO_HOST}/omada
With the change I propose, this is covered as the content of the variable is expanded, so if the environment variable is defined into the connection string, it will be replaced with its content