Skip to content

opts/swarmopts: minor cleanup and refactor#6227

Merged
thaJeztah merged 1 commit intodocker:masterfrom
thaJeztah:cleanup_swarmopts
Jul 31, 2025
Merged

opts/swarmopts: minor cleanup and refactor#6227
thaJeztah merged 1 commit intodocker:masterfrom
thaJeztah:cleanup_swarmopts

Conversation

@thaJeztah
Copy link
Member

  • Use strong-typed switches for validating options
  • Initialize defaults instead of setting them after parsing the ports. Each option should be validated as part of the parsing, so no invalid (or empty) values should be set.
  • Put variables closer to where they're used, and don't construct an empty slice if not needed.

- Human readable description for the release notes

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

@thaJeztah thaJeztah added this to the 29.0.0 milestone Jul 31, 2025
@thaJeztah thaJeztah added status/2-code-review kind/refactor PR's that refactor, or clean-up code labels Jul 31, 2025
@codecov-commenter
Copy link

codecov-commenter commented Jul 31, 2025

Codecov Report

❌ Patch coverage is 93.33333% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
opts/swarmopts/port.go 93.33% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@thaJeztah thaJeztah force-pushed the cleanup_swarmopts branch from 9e0e2a5 to b0f580d Compare July 31, 2025 12:31
- Use strong-typed switches for validating options
- Initialize defaults instead of setting them after
  parsing the ports. Each option should be validated
  as part of the parsing, so no invalid (or empty)
  values should be set.
- Put variables closer to where they're used, and
  pre-allocate slices.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah thaJeztah force-pushed the cleanup_swarmopts branch from b0f580d to 066710b Compare July 31, 2025 16:20
@thaJeztah thaJeztah merged commit a4bf9e7 into docker:master Jul 31, 2025
87 checks passed
@thaJeztah thaJeztah deleted the cleanup_swarmopts branch July 31, 2025 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/refactor PR's that refactor, or clean-up code status/2-code-review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants