Skip to content

Conversation

@mokibit
Copy link
Collaborator

@mokibit mokibit commented Jun 30, 2025

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.

This PR completes PR #1240 and fixes issue #708.

Copy link
Collaborator

@p12tic p12tic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thank you. Just one nit.

`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>
@mokibit mokibit force-pushed the add-env-var-interpolation-to-keys branch from 55a6cc4 to e97d446 Compare June 30, 2025 20:54
@p12tic p12tic merged commit 2ed50b9 into containers:main Jun 30, 2025
8 checks passed
@mokibit mokibit deleted the add-env-var-interpolation-to-keys branch June 30, 2025 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants