Skip to content

cli/compose: assorted fixes and cleanups#6803

Draft
thaJeztah wants to merge 6 commits intodocker:masterfrom
thaJeztah:compose_fixes
Draft

cli/compose: assorted fixes and cleanups#6803
thaJeztah wants to merge 6 commits intodocker:masterfrom
thaJeztah:compose_fixes

Conversation

@thaJeztah
Copy link
Member

cli/compose/convert: convertUlimits: modernize

cli/compose/convert: convertEndpointSpec: fix sorting of ports

The existing code only sorted by PublishedPort (host port), and did
not account for multiple ports mapped to the same host-port, but
using a different protocol.

cli/compose/loader: mergeServices: tidy up and modernize

  • construct merge-opts as a slice
  • remove intermediate var for overrideServices
  • use slices.SortFunc for sorting

cli/compose/loader: mergeServices: remove intermediate map for overrides

The code was using an intermediate map, indexed by name, for both the
"base" services and for overrides. This meant that multiple files
containing an override for a service would be ignored.

Remove the intermediate map for overrides, and apply all overrides for
a service instead.

cli/compose/loader: mergeServices: inline mapByName

It's now only used once; let's inline it to remove some abstraction.

cli/compose/loader: remove getLoggingDriver

Inline it in mergeLoggingConfig and add some vars, which also
makes it more readable.

- Human readable description for the release notes

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

@thaJeztah thaJeztah added status/2-code-review area/stack kind/refactor PR's that refactor, or clean-up code labels Feb 15, 2026
@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 62.79070% with 16 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
cli/compose/convert/service.go 33.33% 13 Missing and 1 partial ⚠️
cli/compose/loader/merge.go 90.90% 1 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
The existing code only sorted by PublishedPort (host port), and did
not account for multiple ports mapped to the same host-port, but
using a different protocol.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
- construct merge-opts as a slice
- remove intermediate var for overrideServices
- use slices.SortFunc for sorting

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
The code was using an intermediate map, indexed by name, for both the
"base" services _and_ for overrides. This meant that multiple files
containing an override for a service would be ignored.

Remove the intermediate map for overrides, and apply all overrides for
a service instead.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
It's now only used once; let's inline it to remove some abstraction.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Inline it in mergeLoggingConfig and add some vars, which also
makes it more readable.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/stack 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.

2 participants