Skip to content

opts: preserve case in network option values - #7317

Open
a3ylf wants to merge 1 commit into
docker:masterfrom
a3ylf:fix/preserve-network-option-case
Open

a3ylf wants to merge 1 commit into
docker:masterfrom
a3ylf:fix/preserve-network-option-case

Conversation

@a3ylf

@a3ylf a3ylf commented Sep 20, 2026

Copy link
Copy Markdown

Summary

The advanced --network syntax lowercases the entire option, including network names, aliases, and driver option keys and values. For example, --network name=MyNetwork,alias=WebApp makes container startup fail with network mynetwork not found even when MyNetwork exists. The short --network MyNetwork syntax preserves the name.

Normalize only the outer option key and preserve the supplied values. Also remove the second lowercasing pass in parseDriverOpt. Outer keys such as NAME remain accepted. Extend the existing parser and container configuration tests to cover mixed-case values, and correct the existing sysctl expectation to preserve IFNAME.

Validation:

  • The parser regression fails on the base revision. All 90 non-e2e packages selected by host CI pass with Go 1.26.7.
  • golangci-lint v2.13.2 run ./opts/... ./cli/command/container/... passes.
  • Built the CLI and checked against Docker Engine 29.5.3: the installed 29.5.3 CLI fails to start a container on a mixed-case network; the patched CLI preserves the network name and WebApp alias, and the container starts successfully. Driver option preservation is covered by the unit tests.

Release notes (optional)

Preserve network names, aliases, and driver option keys and values in the advanced --network syntax.

Signed-off-by: Alexandre Rodrigues <alexandre3ylf@gmail.com>
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.

1 participant