From 0e5ff488dee5d32f78dc20fb9a0f5e84b031656a Mon Sep 17 00:00:00 2001 From: Albin Kerouanton Date: Thu, 28 Aug 2025 13:12:05 +0200 Subject: [PATCH] api/t/ctr: deprecate NetworkSettingsBase.Bridge This field provides little value as it's only set when the daemon is started with --bridge flag specified, and the inspected container is connected to the default bridge network. Unfortunately, there's no equivalent field in NetworkSettings.Networks. Signed-off-by: Albin Kerouanton (cherry picked from commit 16dc39136cae7f04b04f8fc50ac312d78a4c79d5) Signed-off-by: Albin Kerouanton --- api/swagger.yaml | 2 ++ api/types/container/network_settings.go | 2 +- docs/api/v1.50.yaml | 2 ++ docs/api/v1.51.yaml | 2 ++ docs/api/version-history.md | 2 ++ 5 files changed, 9 insertions(+), 1 deletion(-) diff --git a/api/swagger.yaml b/api/swagger.yaml index 16da2ce491..1401fa7153 100644 --- a/api/swagger.yaml +++ b/api/swagger.yaml @@ -1608,6 +1608,8 @@ definitions: Bridge: description: | Name of the default bridge interface when dockerd's --bridge flag is set. + + Deprecated: This field is only set when the daemon is started with the --bridge flag specified. type: "string" example: "docker0" SandboxID: diff --git a/api/types/container/network_settings.go b/api/types/container/network_settings.go index afec0e5432..454f9809e4 100644 --- a/api/types/container/network_settings.go +++ b/api/types/container/network_settings.go @@ -14,7 +14,7 @@ type NetworkSettings struct { // NetworkSettingsBase holds networking state for a container when inspecting it. type NetworkSettingsBase struct { - Bridge string // Bridge contains the name of the default bridge interface iff it was set through the daemon --bridge flag. + Bridge string // Deprecated: This field is only set when the daemon is started with the --bridge flag specified. SandboxID string // SandboxID uniquely represents a container's network stack SandboxKey string // SandboxKey identifies the sandbox Ports nat.PortMap // Ports is a collection of PortBinding indexed by Port diff --git a/docs/api/v1.50.yaml b/docs/api/v1.50.yaml index f93605dc0c..6b18935d3d 100644 --- a/docs/api/v1.50.yaml +++ b/docs/api/v1.50.yaml @@ -1608,6 +1608,8 @@ definitions: Bridge: description: | Name of the default bridge interface when dockerd's --bridge flag is set. + + Deprecated: This field is only set when the daemon is started with the --bridge flag specified. type: "string" example: "docker0" SandboxID: diff --git a/docs/api/v1.51.yaml b/docs/api/v1.51.yaml index 16da2ce491..1401fa7153 100644 --- a/docs/api/v1.51.yaml +++ b/docs/api/v1.51.yaml @@ -1608,6 +1608,8 @@ definitions: Bridge: description: | Name of the default bridge interface when dockerd's --bridge flag is set. + + Deprecated: This field is only set when the daemon is started with the --bridge flag specified. type: "string" example: "docker0" SandboxID: diff --git a/docs/api/version-history.md b/docs/api/version-history.md index 4e295e4526..ae06a8f4fb 100644 --- a/docs/api/version-history.md +++ b/docs/api/version-history.md @@ -20,6 +20,8 @@ keywords: "API, Docker, rcli, REST, documentation" * `GET /images/json` now sets the value of `Containers` field for all images to the count of containers using the image. This field was previously always -1. +* Deprecated: The field `NetworkSettings.Bridge` returned by `GET /containers/{id}/json` + is deprecated and will be removed in the next API version. ## v1.50 API changes