api/types: move container-networksettings types to api/types/container

This moves the NetworkSettings, NetworkSettingsBase, DefaultNetworkSettings,
and SummaryNetworkSettings types to the api/types/container package, and
deprecates the old location.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn
2024-06-25 18:09:50 +02:00
parent a045f9e65d
commit df22a511cb
5 changed files with 122 additions and 94 deletions

View File

@@ -72,8 +72,8 @@ func (daemon *Daemon) ContainerInspectCurrent(ctx context.Context, name string,
}
mountPoints := ctr.GetMountPoints()
networkSettings := &types.NetworkSettings{
NetworkSettingsBase: types.NetworkSettingsBase{
networkSettings := &containertypes.NetworkSettings{
NetworkSettingsBase: containertypes.NetworkSettingsBase{
Bridge: ctr.NetworkSettings.Bridge,
SandboxID: ctr.NetworkSettings.SandboxID,
SandboxKey: ctr.NetworkSettings.SandboxKey,
@@ -247,13 +247,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) types.DefaultNetworkSettings {
func getDefaultNetworkSettings(networks map[string]*network.EndpointSettings) containertypes.DefaultNetworkSettings {
nw, ok := networks[networktypes.NetworkBridge]
if !ok || nw.EndpointSettings == nil {
return types.DefaultNetworkSettings{}
return containertypes.DefaultNetworkSettings{}
}
return types.DefaultNetworkSettings{
return containertypes.DefaultNetworkSettings{
EndpointID: nw.EndpointSettings.EndpointID,
Gateway: nw.EndpointSettings.Gateway,
GlobalIPv6Address: nw.EndpointSettings.GlobalIPv6Address,