api/t/ctr: deprecate NetworkSettingsBase

Most fields in NetworkSettingsBase are deprecated, so deprecate the
whole struct. The few fields which aren't deprecated will move to the
NetworkSettings struct in v29.

Signed-off-by: Albin Kerouanton <albinker@gmail.com>
(cherry picked from commit 80bb864fd6)
Signed-off-by: Albin Kerouanton <albinker@gmail.com>
This commit is contained in:
Albin Kerouanton
2025-08-28 13:12:30 +02:00
parent 0e5ff488de
commit 65a1687e3d
3 changed files with 5 additions and 2 deletions

View File

@@ -13,6 +13,9 @@ type NetworkSettings struct {
}
// NetworkSettingsBase holds networking state for a container when inspecting it.
//
// Deprecated: Most fields in NetworkSettingsBase are deprecated. Fields which aren't deprecated will move to
// NetworkSettings in v29.0, and this struct will be removed.
type NetworkSettingsBase struct {
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

View File

@@ -47,7 +47,7 @@ type NetworkSettings = container.NetworkSettings
// NetworkSettingsBase holds networking state for a container when inspecting it.
//
// Deprecated: use [container.NetworkSettingsBase].
type NetworkSettingsBase = container.NetworkSettingsBase
type NetworkSettingsBase = container.NetworkSettingsBase //nolint:staticcheck // ignore SA1019: NetworkSettingsBase is deprecated in v28.4.
// DefaultNetworkSettings holds network information
// during the 2 release deprecation period.

View File

@@ -47,7 +47,7 @@ func (daemon *Daemon) ContainerInspect(ctx context.Context, name string, options
mountPoints := ctr.GetMountPoints()
networkSettings := &containertypes.NetworkSettings{
NetworkSettingsBase: containertypes.NetworkSettingsBase{
NetworkSettingsBase: containertypes.NetworkSettingsBase{ //nolint:staticcheck // ignore SA1019: NetworkSettingsBase is deprecated in v28.4.
Bridge: ctr.NetworkSettings.Bridge,
SandboxID: ctr.NetworkSettings.SandboxID,
SandboxKey: ctr.NetworkSettings.SandboxKey,