Fix COMPOSE_PROJECT_NAME variable parsing order regression #805
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.
In a previous change (9d5b255) the support to read
COMPOSE_PROJECT_NAME
from thename
attribute in thecompose.yml
file was added. Since the attribute is only available after parsing the compose file, the resolution of the variable was done afterwards.The variable is therefore usable inside the container, HOWEVER it can no longer be used for substitution while loading the compose file. Values that depend on this variable are therefore empty at the point of parsing the compose file.
COMPOSE_PROJECT_NAME
is either loaded from the environment or set todir_basename
by default.This commit changes the order of parsing
COMPOSE_PROJECT_NAME
variable. First the compose file is loaded into a dict, then the singlename
attribute is evaluated and replaced, then if it does not exist, the default value is used.