api/t/ctr: deprecate DefaultNetworkSettings

This struct is only used to report the networking state for the default
bridge network when the container is connected to it.

It was deprecated in v1.09 (API v1.21), and scheduled for removal in
v1.11. Unfortunately, the deprecation warning was wrongly formatted in
the Go code. However, deprecation warnings are already present in
swagger.yaml, so don't touch it.

Signed-off-by: Albin Kerouanton <albinker@gmail.com>
This commit is contained in:
Albin Kerouanton
2025-08-28 13:17:42 +02:00
parent d0de293513
commit b7c597ec35
7 changed files with 85 additions and 35 deletions

View File

@@ -242,13 +242,13 @@ func (daemon *Daemon) ContainerExecInspect(id string) (*backend.ExecInspect, err
// getDefaultNetworkSettings creates the deprecated structure that holds the information
// about the bridge network for a container.
func getDefaultNetworkSettings(networks map[string]*network.EndpointSettings) containertypes.DefaultNetworkSettings {
func getDefaultNetworkSettings(networks map[string]*network.EndpointSettings) containertypes.DefaultNetworkSettings { //nolint:staticcheck // ignore SA1019: DefaultNetworkSettings is deprecated in v28.4.
nw, ok := networks[networktypes.NetworkBridge]
if !ok || nw.EndpointSettings == nil {
return containertypes.DefaultNetworkSettings{}
return containertypes.DefaultNetworkSettings{} //nolint:staticcheck // ignore SA1019: DefaultNetworkSettings is deprecated in v28.4.
}
return containertypes.DefaultNetworkSettings{
return containertypes.DefaultNetworkSettings{ //nolint:staticcheck // ignore SA1019: DefaultNetworkSettings is deprecated in v28.4.
EndpointID: nw.EndpointSettings.EndpointID,
Gateway: nw.EndpointSettings.Gateway,
GlobalIPv6Address: nw.EndpointSettings.GlobalIPv6Address,