Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix variable extraction when string uses variables concatenation #626

Merged
merged 1 commit into from
May 14, 2024

Conversation

ndeloof
Copy link
Collaborator

@ndeloof ndeloof commented May 14, 2024

by using (.*) to capture default value, variable regex can't distinguish multiple variables being concatenated
trying to fix the regex doesn't seem trivial (at least for me) and introduces a risk to break variable interpolation, so I preferred to replicate the interpolate login in variable extraction to recursively search for variables in the default value

also moved variable extraction logic to a dedicated go file for clarity

fixes docker/compose#11785

Copy link
Contributor

@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

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
@ndeloof ndeloof merged commit 2bbabf1 into compose-spec:main May 14, 2024
8 checks passed
@ndeloof ndeloof deleted the extract_variables branch May 14, 2024 09:15
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.

[BUG] config --variables lists broken variable names
2 participants