From f25172f67bdf70eb9d4ef56d6c81045dc8889dde Mon Sep 17 00:00:00 2001 From: caoyin0727 Date: Wed, 2 Dec 2015 12:21:54 +0800 Subject: [PATCH 1/3] add missing "options" field while inspecting network --- types.go | 1 + 1 file changed, 1 insertion(+) diff --git a/types.go b/types.go index 95dcb42..91f355c 100644 --- a/types.go +++ b/types.go @@ -502,6 +502,7 @@ type NetworkResource struct { Driver string IPAM IPAM Containers map[string]EndpointResource + Options map[string]string } //EndpointResource contains network resources allocated and usd for a container in a network From 65542ed75e236ce7f20be5827981e53688d79538 Mon Sep 17 00:00:00 2001 From: caoyin0727 Date: Wed, 2 Dec 2015 14:02:42 +0800 Subject: [PATCH 2/3] add "Networks" field introduced in v1.21 --- types.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/types.go b/types.go index 91f355c..3ae0c8f 100644 --- a/types.go +++ b/types.go @@ -233,6 +233,7 @@ type ContainerInfo struct { Gateway string Bridge string Ports map[string][]PortBinding + Networks map[string]*EndpointSettings } SysInitPath string ResolvConfPath string @@ -537,3 +538,15 @@ type NetworkConnect struct { type NetworkDisconnect struct { Container string } + +// EndpointSettings stores the network endpoint details +type EndpointSettings struct { + EndpointID string + Gateway string + IPAddress string + IPPrefixLen int + IPv6Gateway string + GlobalIPv6Address string + GlobalIPv6PrefixLen int + MacAddress string +} From b3d83f4779eaea5f59f849a3fce3cc80890bb7da Mon Sep 17 00:00:00 2001 From: caoyin0727 Date: Wed, 2 Dec 2015 14:04:34 +0800 Subject: [PATCH 3/3] fix wrong type of 'MemorySwappiness' --- types.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types.go b/types.go index 3ae0c8f..34c5c6d 100644 --- a/types.go +++ b/types.go @@ -60,7 +60,7 @@ type HostConfig struct { CpuQuota int64 BlkioWeight int64 OomKillDisable bool - MemorySwappiness int64 + MemorySwappiness *int64 Privileged bool PortBindings map[string][]PortBinding Links []string