`podman-compose` currently does not support interpolating environment
variables in dictionary keys, despite the compose file specification
indicating this capability.
See the relevant compose-spec documentation:
https://github.com/compose-spec/compose-spec/blob/main/12-interpolation.md
This feature is useful in `labels` or `environment` sections, where keys
can be user-defined strings. To enable interpolation, an alternate equal
sign syntax must be used, e.g.:
services:
foo:
labels:
- "$VAR_NAME=label_value"
After this PR `podman-compose` will align more closely with the compose
file specification, allowing for the interpolation of environment
variables in dictionary keys.
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
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>