Skip to content

nat: ParsePortSpec: validate port before proto#143

Merged
austinvazquez merged 1 commit intodocker:mainfrom
thaJeztah:fix_ParsePortSpec
Aug 11, 2025
Merged

nat: ParsePortSpec: validate port before proto#143
austinvazquez merged 1 commit intodocker:mainfrom
thaJeztah:fix_ParsePortSpec

Conversation

@thaJeztah
Copy link
Member

relates to:

commit f388222 made an optimization to handle validating the proto before parsing port-numbers, but as a result changed the error returned if the port was missing.

This patch moves the check for empty container ports to the start to keep the old behavior. The error-message(s) can probably be improved a bit, but this keeps the existing output.

- What I did

- How I did it

- How to verify it

- Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)

commit f388222 made an optimization
to handle validating the proto before parsing port-numbers, but
as a result changed the error returned if the port was missing.

This patch moves the check for empty container ports to the start
to keep the old behavior. The error-message(s) can probably be
improved a bit, but this keeps the existing output.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@austinvazquez austinvazquez merged commit cf3fce2 into docker:main Aug 11, 2025
13 checks passed
@thaJeztah thaJeztah deleted the fix_ParsePortSpec branch August 11, 2025 12:16
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.

2 participants