moby/api/server/router
Rob Murray 0451b287dc 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>
(cherry picked from commit a580544d82)
Signed-off-by: Albin Kerouanton <albinker@gmail.com>
2024-03-06 11:20:10 +01:00
..
build migrate to github.com/containerd/log v0.1.0 2023-10-11 17:52:23 +02:00
checkpoint api/types: move checkpoint-types to api/types/checkpoint 2023-08-26 12:37:41 +02:00
container Don't create endpoint config for MAC addr config migration 2024-03-06 11:20:10 +01:00
debug Switch from x/net/context -> context 2018-04-23 13:52:44 -07:00
distribution api: fix "GET /distribution" endpoint ignoring mirrors 2024-01-04 15:46:32 +01:00
grpc Add otel support 2023-09-07 18:38:19 +00:00
image Set Created to 0001-01-01T00:00:00Z on older API versions 2024-02-14 09:11:21 -07:00
network api/types: move NetworkListConfig to api/types/backend 2023-12-06 02:21:21 +01:00
plugin api/types: move Plugin-types to api/types/backend 2023-12-06 02:16:02 +01:00
session move /session api endpoint out of experimental 2018-08-21 22:43:34 +00:00
swarm add validation and migration for deprecated logentries driver 2023-12-13 01:10:05 +01:00
system Merge pull request #46943 from thaJeztah/typo_fixes 2023-12-15 18:39:40 +01:00
volume migrate to github.com/containerd/log v0.1.0 2023-10-11 17:52:23 +02:00
experimental.go fix typos 2018-09-01 21:26:38 +08:00
local.go api/server/router: use consts for HTTP methods 2019-11-26 21:55:29 +01:00
router.go Add canonical import comment 2018-02-05 16:51:57 -05:00