Skip to content

Extract variables nested in required-error messages - #992

Open
kaygaaf wants to merge 1 commit into
compose-spec:mainfrom
kaygaaf:fix-extract-vars-required-error
Open

kaygaaf wants to merge 1 commit into
compose-spec:mainfrom
kaygaaf:fix-extract-vars-required-error

Conversation

@kaygaaf

@kaygaaf kaygaaf commented Nov 6, 2026

Copy link
Copy Markdown

ExtractVariables already walked nested interpolations inside :- and :+ values, but it skipped the :? / ? error message. That meant ${U:?${B}} and ${U?$B} only reported U, even though Substitute does expand B when it builds the missing-variable error.

The compose spec lists ${VARIABLE?$FOO} among nested interpolations, so I walk that operand the same way as the default and presence ones.

Fixes #934

ExtractVariables already walked nested interpolations in :- and :+
operands, but not in the :? / ? error message. So ${U:?${B}} and
${U?$B} only reported U, even though Substitute expands B when it
builds the missing-variable error.

The compose spec lists ${VARIABLE?$FOO} among nested interpolations.
Walk the required-error operand the same way as the default and
presence ones.

Fixes compose-spec#934

Signed-off-by: Kay van Dijk <git@vandijk.one>
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.

ExtractVariables does not report a variable used inside a ${VAR:?…} message

1 participant