moby/api/server
Rob Murray a580544d82 Don't create endpoint config for MAC addr config migration
In a container-create API request, HostConfig.NetworkMode (the identity
of the "main" network) may be a name, id or short-id.

The configuration for that network, including preferred IP address etc,
may be keyed on network name or id - it need not match the NetworkMode.

So, when migrating the old container-wide MAC address to the new
per-endpoint field - it is not safe to create a new EndpointSettings
entry unless there is no possibility that it will duplicate settings
intended for the same network (because one of the duplicates will be
discarded later, dropping the settings it contains).

This change introduces a new API restriction, if the deprecated container
wide field is used in the new API, and EndpointsConfig is provided for
any network, the NetworkMode and key under which the EndpointsConfig is
store must be the same - no mixing of ids and names.

Signed-off-by: Rob Murray <rob.murray@docker.com>
2024-02-29 17:02:19 +00:00
..
backend/build migrate to new github.com/distribution/reference module 2023-09-05 12:09:26 +02:00
httpstatus migrate to github.com/containerd/log v0.1.0 2023-10-11 17:52:23 +02:00
httputils api: remove handling of HostConfig on POST /containers/{id}/start (api < v1.24) 2024-02-06 18:44:44 +01:00
middleware api/server/middleware: NewVersionMiddleware: add validation 2024-02-06 18:44:45 +01:00
router Don't create endpoint config for MAC addr config migration 2024-02-29 17:02:19 +00:00
middleware.go migrate to github.com/containerd/log v0.1.0 2023-10-11 17:52:23 +02:00
server.go api: remove plain-text error-responses (api < v1.24) 2024-02-06 18:44:44 +01:00
server_test.go api/server/middleware: NewVersionMiddleware: add validation 2024-02-06 18:44:45 +01:00