Fix network inspect for default networks.

- Keep old fields in NetworkSetting to respect the deprecation policy.

Signed-off-by: David Calavera <david.calavera@gmail.com>
(cherry picked from commit f301c5765a0d7f4b6866cedfdface6f87874ff53)
This commit is contained in:
David Calavera
2015-10-30 21:18:07 -04:00
committed by Tibor Vass
parent 51e5073111
commit 2ec7433aa4
7 changed files with 123 additions and 49 deletions
+15
View File
@@ -286,6 +286,7 @@ type ContainerJSON struct {
// NetworkSettings exposes the network settings in the api
type NetworkSettings struct {
NetworkSettingsBase
DefaultNetworkSettings
Networks map[string]*network.EndpointSettings
}
@@ -302,6 +303,20 @@ type NetworkSettingsBase struct {
SecondaryIPv6Addresses []network.Address
}
// DefaultNetworkSettings holds network information
// during the 2 release deprecation period.
// It will be removed in Docker 1.11.
type DefaultNetworkSettings struct {
EndpointID string
Gateway string
GlobalIPv6Address string
GlobalIPv6PrefixLen int
IPAddress string
IPPrefixLen int
IPv6Gateway string
MacAddress string
}
// MountPoint represents a mount point configuration inside the container.
type MountPoint struct {
Name string `json:",omitempty"`
+1 -8
View File
@@ -36,12 +36,5 @@ type StatsJSON struct {
// NetworkSettings is a backward compatible struct for APIs prior to 1.21
type NetworkSettings struct {
types.NetworkSettingsBase
EndpointID string
Gateway string
GlobalIPv6Address string
GlobalIPv6PrefixLen int
IPAddress string
IPPrefixLen int
IPv6Gateway string
MacAddress string
types.DefaultNetworkSettings
}