Skip to content

compose: don't treat hyphens in :? error messages as defaults - #7316

Open
TastyHeadphones wants to merge 1 commit into
docker:masterfrom
TastyHeadphones:fix/stack-interp-hyphen-in-required-msg
Open

TastyHeadphones wants to merge 1 commit into
docker:masterfrom
TastyHeadphones:fix/stack-interp-hyphen-in-required-msg

Conversation

@TastyHeadphones

Copy link
Copy Markdown

${VAR:?must be set - try again} was succeeding when VAR was unset, because hardDefault matched the - inside the error message and treated it as ${VAR-default}.

Reordered the substitute funcs so :? / ? run before -, and made hardDefault skip strings that already contain ?. Added regression tests.

Fixes #7313

hardDefault ran before requiredNonEmpty and matched any "-", so a
required-variable error message like "must be set - try again" was
parsed as ${VAR-default} and silently succeeded.

Fixes docker#7313
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.

docker stack subcommands: the :? interpolation operator and hyphens do not mix

1 participant