mirror of
https://github.com/containers/podman-compose.git
synced 2025-08-18 17:38:34 +02:00
expand service environment_variables before adding to subs_dict
Also modifies an existing integration test to expect an empty string as `docker-compose` warns that `ZZVAR3` is not set and defaults it to an empty string per the acutal output here. ```yaml $ docker-compose -f container-compose.load-.env-in-project.yaml config WARN[0000] The "ZZVAR3" variable is not set. Defaulting to a blank string. name: project services: app: command: - /bin/busybox - sh - -c - env | grep ZZ environment: ZZVAR1: This value is loaded but should be overwritten ZZVAR2: This value is loaded from .env in project/ directory ZZVAR3: "" ... ``` Signed-off-by: indra <indra.talip@gmail.com>
This commit is contained in:
@@ -270,7 +270,6 @@ def rec_subs(value, subs_dict):
|
||||
svc_envs = {k: v for k, v in value['environment'].items() if k not in subs_dict}
|
||||
# we need to add `svc_envs` to the `subs_dict` so that it can evaluate the
|
||||
# service environment that reference to another service environment.
|
||||
subs_dict.update(svc_envs)
|
||||
svc_envs = rec_subs(svc_envs, subs_dict)
|
||||
subs_dict.update(svc_envs)
|
||||
|
||||
|
Reference in New Issue
Block a user