Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix required env vars ignored except the last one
During the variable substitution, if a missing variable was followed by an existing one, the empty "err" variable overwrote the previous non-empty variable. Unlike with Docker Compose v1, the first found error did not guarantee that an actual error would be thrown. Example which would have run before the fix even though var1 is not defined: ```yaml services: bash: image: bash:5.0.18-alpine3.15 environment: var12: "_ ${var1:?Error1} _ ${var2:?Error2} _ " command: - env ``` ```bash # var2=1 docker compose up ``` This change also means that, if multiple variables are missing in one string, the first one will be reported by Docker Compose Signed-off-by: Ákos Takács <takacs.akos@it-sziget.hu>
- Loading branch information
Showing
2 changed files
with
13 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters