The Wayback Machine - https://web.archive.org/web/20260308114830/https://github.com/docker/compose/pull/13580
Skip to content

pkg/compose: defaultNetworkSettings: refactor#13580

Merged
glours merged 2 commits intodocker:mainfrom
thaJeztah:cleanup_defaultNetworkSettings
Feb 11, 2026
Merged

pkg/compose: defaultNetworkSettings: refactor#13580
glours merged 2 commits intodocker:mainfrom
thaJeztah:cleanup_defaultNetworkSettings

Conversation

@thaJeztah
Copy link
Member

@thaJeztah thaJeztah commented Feb 10, 2026

pkg/compose: defaultNetworkSettings: return early for unsupported features

pkg/compose: defaultNetworkSettings: slight refactor

  • use an intermediate serviceNetworks slice so that we don't have to call service.NetworksByPriority multiple times.
  • shift the primary network from the slice (if any), so that we can drop some checks for "additional networks"
  • group code related to setting up the primary network as first step, then append remaining networks.

What I did

Related issue

(not mandatory) A picture of a cute animal, if possible in relation to what you did

@codecov
Copy link

codecov bot commented Feb 10, 2026

Codecov Report

❌ Patch coverage is 80.95238% with 4 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
pkg/compose/create.go 80.95% 2 Missing and 2 partials ⚠️

📢 Thoughts on this report? Let us know!

…ture

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
- use an intermediate serviceNetworks slice so that we don't have
  to call service.NetworksByPriority multiple times.
- shift the primary network from the slice (if any), so that
  we can drop some checks for "additional networks"
- group code related to setting up the primary network as first
  step, then append remaining networks.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah thaJeztah force-pushed the cleanup_defaultNetworkSettings branch from 19edbd9 to 28a46aa Compare February 11, 2026 11:42
@thaJeztah thaJeztah marked this pull request as ready for review February 11, 2026 11:43
@thaJeztah thaJeztah requested a review from a team as a code owner February 11, 2026 11:43
@thaJeztah thaJeztah requested review from glours and ndeloof February 11, 2026 11:43
@thaJeztah thaJeztah mentioned this pull request Feb 11, 2026
1 task
@glours glours merged commit fefdc95 into docker:main Feb 11, 2026
40 checks passed
@thaJeztah thaJeztah deleted the cleanup_defaultNetworkSettings branch February 11, 2026 15:06
@thaJeztah
Copy link
Member Author

Thx! I rebased #13584 and moved it out of draft

tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request Feb 25, 2026
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [docker/compose](https://github.com/docker/compose) | minor | `v5.0.2` → `v5.1.0` |

MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot).

**Proposed changes to behavior should be submitted there as MRs.**

---

### Release Notes

<details>
<summary>docker/compose (docker/compose)</summary>

### [`v5.1.0`](https://github.com/docker/compose/releases/tag/v5.1.0)

[Compare Source](docker/compose@v5.0.2...v5.1.0)

#### What's Changed

##### 🐛 Fixes

- emit container status events after network reconnection (fixes [#&#8203;13524](docker/compose#13524)) by [@&#8203;MaheshThakur9152](https://github.com/MaheshThakur9152) in [#&#8203;13529](docker/compose#13529)
- Fix potential nil pointer dereference in container event monitoring by [@&#8203;Nepomuk5665](https://github.com/Nepomuk5665) in [#&#8203;13551](docker/compose#13551)
- compose: recreate container when mounted image digest changes by [@&#8203;ibrahimypr](https://github.com/ibrahimypr) in [#&#8203;13549](docker/compose#13549)
- fix panic by [@&#8203;ndeloof](https://github.com/ndeloof) in [#&#8203;13562](docker/compose#13562)
- Fix invalid path error when using OCI artifacts on Windows by [@&#8203;mikesir87](https://github.com/mikesir87) in [#&#8203;13574](docker/compose#13574)
- fix: execute post\_start hooks in docker compose run by [@&#8203;veeceey](https://github.com/veeceey) in [#&#8203;13607](docker/compose#13607)
- Fix panic when watch rebuilds without up by [@&#8203;maxproske](https://github.com/maxproske) in [#&#8203;13610](docker/compose#13610)

##### 🔧  Internal

- fsnotify is set in Dockerfile by [@&#8203;ndeloof](https://github.com/ndeloof) in [#&#8203;13533](docker/compose#13533)
- Dockerfile: update golangci-lint to v2.8.0 by [@&#8203;thaJeztah](https://github.com/thaJeztah) in [#&#8203;13535](docker/compose#13535)
- replace some uses of strings.Split(N) for strings.Cut by [@&#8203;thaJeztah](https://github.com/thaJeztah) in [#&#8203;13542](docker/compose#13542)
- Upgrade GitHub Actions to latest versions by [@&#8203;salmanmkc](https://github.com/salmanmkc) in [#&#8203;13546](docker/compose#13546)
- pkg/compose: remove dependency on github.com/docker/buildx/driver by [@&#8203;thaJeztah](https://github.com/thaJeztah) in [#&#8203;13563](docker/compose#13563)
- use Docker GitHub Builder to build and sign binaries and bin image by [@&#8203;crazy-max](https://github.com/crazy-max) in [#&#8203;13568](docker/compose#13568)
- ci: fix bin-image job by [@&#8203;crazy-max](https://github.com/crazy-max) in [#&#8203;13569](docker/compose#13569)
- pkg/compose: defaultNetworkSettings: refactor by [@&#8203;thaJeztah](https://github.com/thaJeztah) in [#&#8203;13580](docker/compose#13580)
- pkg/compose: un-export consts by [@&#8203;thaJeztah](https://github.com/thaJeztah) in [#&#8203;13584](docker/compose#13584)
- modernize some code by [@&#8203;thaJeztah](https://github.com/thaJeztah) in [#&#8203;13588](docker/compose#13588)

##### ⚙️ Dependencies

- update to go1.25.7 by [@&#8203;thaJeztah](https://github.com/thaJeztah) in [#&#8203;13573](docker/compose#13573)
- build(deps): bump golang.org/x/sys from 0.40.0 to 0.41.0 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;13578](docker/compose#13578)
- build(deps): bump go.yaml.in/yaml/v4 from 4.0.0-rc.3 to 4.0.0-rc.4 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;13541](docker/compose#13541)
- migrate to moby modules by [@&#8203;thaJeztah](https://github.com/thaJeztah) in [#&#8203;13078](docker/compose#13078)

#### New Contributors

- [@&#8203;MaheshThakur9152](https://github.com/MaheshThakur9152) made their first contribution in [#&#8203;13529](docker/compose#13529)
- [@&#8203;salmanmkc](https://github.com/salmanmkc) made their first contribution in [#&#8203;13546](docker/compose#13546)
- [@&#8203;Nepomuk5665](https://github.com/Nepomuk5665) made their first contribution in [#&#8203;13551](docker/compose#13551)
- [@&#8203;ibrahimypr](https://github.com/ibrahimypr) made their first contribution in [#&#8203;13549](docker/compose#13549)
- [@&#8203;veeceey](https://github.com/veeceey) made their first contribution in [#&#8203;13607](docker/compose#13607)

**Full Changelog**: <docker/compose@v5.0.2...v5.1.0>

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this MR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4zNS4xIiwidXBkYXRlZEluVmVyIjoiNDMuMzUuMSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiUmVub3ZhdGUgQm90IiwiYXV0b21hdGlvbjpib3QtYXV0aG9yZWQiLCJkZXBlbmRlbmN5LXR5cGU6Om1pbm9yIl19-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants