compose/pkg
Milas Bowman be22bc735a network: fix random missing network when service has more than one
As part of the fix for #10668, the logic was adjusted so that the
default (highest-priority) network is used in the `ContainerCreate`,
and then the remaining networks are connected via calls to
`NetworkConnect` before starting the container.

Unfortunately, `ServiceConfig::NetworksByPriority` is neither
deterministic nor stable when networks have the same priority.

It's non-deterministic because the order of networks from parsing
YAML is random, since they are loaded into a Go map (which have
random iteration order). Additionally, it's not using a `SortStable`
in `compose-go`, so even if the load order was predictable, it
still might produce different results.

While I look at improving `compose-go` here to prevent this from
tripping us up in the future, this fix looks at _all_ networks for
a service and ignores the "default" one now. Before, it would
always skip the first one in the slice since that _should_ have
been the "default".

Signed-off-by: Milas Bowman <milas.bowman@docker.com>
2023-07-07 09:18:01 +02:00
..
api don't use unitialized cli to setup DryRunClient 2023-07-06 14:27:57 +02:00
compose network: fix random missing network when service has more than one 2023-07-07 09:18:01 +02:00
e2e network: fix random missing network when service has more than one 2023-07-07 09:18:01 +02:00
mocks Add `docker compose wait` 2023-06-30 16:07:03 +02:00
progress use `--progress` to configure progress UI stylet push 2023-06-12 16:53:42 +02:00
prompt use a simpler prompt implementation when we lack a terminal 2023-01-09 10:28:16 +01:00
utils fix some comments 2023-07-04 11:34:49 +08:00
watch fix typos 2023-06-27 16:12:25 +02:00