Skip to content

fix(docker): parse quoted and hyphenated custom docker option values - #12208

Open
andrasbacsai wants to merge 3 commits into
mainfrom
issue-8173-bug-custom-docker-options-parser
Open

andrasbacsai wants to merge 3 commits into
mainfrom
issue-8173-bug-custom-docker-options-parser

Conversation

@andrasbacsai

Copy link
Copy Markdown
Member

Summary

  • Fixes the Custom Docker Options parser cutting values off at the first hyphen. For example, --security-opt no-new-privileges:true was turned into security_opt: ['no'], and the deployment then failed with invalid security-opt: "no".
  • Values can now be written in three ways: unquoted, double-quoted (with escapes), or single-quoted. This works with both the --flag value and --flag=value forms. The parser strips the surrounding quotes, so --security-opt="no-new-privileges:true" no longer produces "\"no".
  • Quoted values can contain spaces and --. Options inside a quoted --entrypoint (for example sh -c '... --privileged ...') are no longer read as separate flags.
  • If a quoted value is empty, such as --security-opt="", the option is skipped.
  • Removed the special-case --hostname regex. Hostname now goes through the general value parsing, which also handles quoted hostnames.
  • Added tests for hyphenated security options, the different quoting styles, quoted list and scalar options, empty quoted values, and flags inside a quoted entrypoint.

fixes #8173


Fixes #8173

This branch has not been deployed

No deployments
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]: Custom Docker Options parser truncates hyphenated values (--security-opt no-new-privileges:true)

1 participant