podman-compose icon indicating copy to clipboard operation
podman-compose copied to clipboard

Fix COMPOSE_PROJECT_NAME variable parsing order regression

Open nkay08 opened this issue 2 years ago • 1 comments

In a previous change (9d5b255) the support to read COMPOSE_PROJECT_NAME from the name attribute in the compose.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 to dir_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 single name attribute is evaluated and replaced, then if it does not exist, the default value is used.

nkay08 avatar Nov 21 '23 09:11 nkay08

I would really like to see this PR merged, this regression has broken many of my deployments

Cabanon avatar Sep 27 '24 13:09 Cabanon

This fix has been merged via https://github.com/containers/podman-compose/pull/1165.

p12tic avatar Apr 14 '25 15:04 p12tic