Conversation
Signed-off-by: pnkcaht <samzoovsk19@gmail.com>
Signed-off-by: pnkcaht <samzoovsk19@gmail.com>
28d7e90 to
1e3fc17
Compare
ndeloof
left a comment
There was a problem hiding this comment.
orderEndpointsByGwPriority returns a map, so won't fix any ordering issue
Also, AFAIK there's no ordering requirements after the priority attribute has been introduced - this was non determinist before this API change, without any workaround.
Is this PR related to an identified issue or just a tentative fix exploring the codebase?
Signed-off-by: pnkcaht <samzoovsk19@gmail.com>
3f95255 to
b73e3fe
Compare
What changedHi again @ndeloof , I made the changes based on your request. 👍
The networking configuration now treats endpoint ordering as undefined and only asserts the intended semantic behavior. Tests
|
|
so this PR adds a test, changes formatting, but doesn't update the code in any way that would help fix #13511 (assuming a fix is needed) |

What I did
Adjusted how
NetworkingConfig.EndpointsConfigis built so that networks are ordered bygw_prioritybefore being sent to the Docker Engine.Previously, even when gw_priority was defined in the Compose file, the order of endpoints passed to the Engine was non-deterministic due to map iteration.
This change ensures endpoints are explicitly ordered by descending gw_priority, matching the expected Compose semantics and Docker Engine behavior.
A helper function was introduced in
defaultNetworkSettingsto sort endpoint settings before constructingNetworkingConfig, and a unit test was added to validate the ordering.Related issue
Fixes #13511
(not mandatory) A picture of a cute animal, if possible in relation to what you did
🐳 Carefully routing containers through the right gateway
Notes
gw_priorityconfigured