Skip to content

do not override a value that has been set by higher-priority environment source#264

Merged
ndeloof merged 1 commit intocompose-spec:masterfrom
ndeloof:env_priority
May 20, 2022
Merged

do not override a value that has been set by higher-priority environment source#264
ndeloof merged 1 commit intocompose-spec:masterfrom
ndeloof:env_priority

Conversation

@ndeloof
Copy link
Collaborator

@ndeloof ndeloof commented May 19, 2022

assuming we have FOO=BAR by os variable, and dot env file :

FOO=default
BAZ=${FOO}

we expect os env var wins, and also set BAZ.
For this to happen, loading dot env file MUST NOT replace a variable previously set from os.Env

closes docker/compose#9442

…ent source

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
@ndeloof ndeloof requested review from glours and ulyssessouza May 19, 2022 10:40
Copy link
Collaborator

@glours glours left a comment

Choose a reason for hiding this comment

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

LGTM

@ndeloof ndeloof merged commit b706902 into compose-spec:master May 20, 2022
@ndeloof ndeloof deleted the env_priority branch May 20, 2022 13:14
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.

Interpolation of variables in .env ignores variable precedence in V2 - was working in V1

2 participants