compose-spec / compose-go

Reference library for parsing and loading Compose YAML files
https://compose-spec.io
Apache License 2.0
355 stars 112 forks source link

Dashes in variable names <=> `environment:` block #663

Closed simonhammes closed 1 month ago

simonhammes commented 3 months ago

Dashes can be used in variable names (https://github.com/compose-spec/compose-go/pull/336).

However, I'm unable to use a variable that contains dashes in an environment: block since compose interprets the dash as a separator between the variable name and its default value:

environment:
  VAR-WITH-DASHES: ${VAR-WITH-DASHES}

Is there any way to escape the dash or is this a bug/unimplemented functionality?

ndeloof commented 1 month ago

- indeed is delimiter for default value, which makes #336 actually irrelevant 😓 I guess we should revert, as this issue demonstrate this "feature" was incomplete and can't be used anyway cc @jhrotko @glours

KasonBraley commented 2 weeks ago

@glours Can this bug fix be released in a patch so compose can release a version with the fix?

https://github.com/docker/compose/issues/12123

ndeloof commented 2 weeks ago

no worries, this will be part of the next compose release coming soon. Cheers