From d68dd18694874a3e830022d7d874659c64a6a135 Mon Sep 17 00:00:00 2001 From: Paul Morie Date: Tue, 19 Apr 2016 16:25:56 -0400 Subject: [PATCH] Bump godep for go-dockerclient --- Godeps/Godeps.json | 36 ++--- .../fsouza/go-dockerclient/.travis.yml | 17 ++- .../github.com/fsouza/go-dockerclient/AUTHORS | 2 + .../fsouza/go-dockerclient/Makefile | 10 -- .../fsouza/go-dockerclient/README.markdown | 3 +- .../github.com/fsouza/go-dockerclient/auth.go | 32 ++++- .../fsouza/go-dockerclient/container.go | 129 ++++++++++++++---- .../fsouza/go-dockerclient/image.go | 9 +- .../fsouza/go-dockerclient/network.go | 5 +- .../fsouza/go-dockerclient/volume.go | 7 +- 10 files changed, 174 insertions(+), 76 deletions(-) diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json index a6705da3..9da73537 100644 --- a/Godeps/Godeps.json +++ b/Godeps/Godeps.json @@ -154,75 +154,75 @@ }, { "ImportPath": "github.com/fsouza/go-dockerclient", - "Rev": "086d16d0c1428734a75065d2aa64e248093d2790" + "Rev": "ff3d4ee4753705a048db1855113026395c26a79a" }, { "ImportPath": "github.com/fsouza/go-dockerclient/external/github.com/Sirupsen/logrus", - "Rev": "086d16d0c1428734a75065d2aa64e248093d2790" + "Rev": "ff3d4ee4753705a048db1855113026395c26a79a" }, { "ImportPath": "github.com/fsouza/go-dockerclient/external/github.com/docker/docker/opts", - "Rev": "086d16d0c1428734a75065d2aa64e248093d2790" + "Rev": "ff3d4ee4753705a048db1855113026395c26a79a" }, { "ImportPath": "github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/archive", - "Rev": "086d16d0c1428734a75065d2aa64e248093d2790" + "Rev": "ff3d4ee4753705a048db1855113026395c26a79a" }, { "ImportPath": "github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/fileutils", - "Rev": "086d16d0c1428734a75065d2aa64e248093d2790" + "Rev": "ff3d4ee4753705a048db1855113026395c26a79a" }, { "ImportPath": "github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/homedir", - "Rev": "086d16d0c1428734a75065d2aa64e248093d2790" + "Rev": "ff3d4ee4753705a048db1855113026395c26a79a" }, { "ImportPath": "github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/idtools", - "Rev": "086d16d0c1428734a75065d2aa64e248093d2790" + "Rev": "ff3d4ee4753705a048db1855113026395c26a79a" }, { "ImportPath": "github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/ioutils", - "Rev": "086d16d0c1428734a75065d2aa64e248093d2790" + "Rev": "ff3d4ee4753705a048db1855113026395c26a79a" }, { "ImportPath": "github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/longpath", - "Rev": "086d16d0c1428734a75065d2aa64e248093d2790" + "Rev": "ff3d4ee4753705a048db1855113026395c26a79a" }, { "ImportPath": "github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/pools", - "Rev": "086d16d0c1428734a75065d2aa64e248093d2790" + "Rev": "ff3d4ee4753705a048db1855113026395c26a79a" }, { "ImportPath": "github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/promise", - "Rev": "086d16d0c1428734a75065d2aa64e248093d2790" + "Rev": "ff3d4ee4753705a048db1855113026395c26a79a" }, { "ImportPath": "github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/stdcopy", - "Rev": "086d16d0c1428734a75065d2aa64e248093d2790" + "Rev": "ff3d4ee4753705a048db1855113026395c26a79a" }, { "ImportPath": "github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/system", - "Rev": "086d16d0c1428734a75065d2aa64e248093d2790" + "Rev": "ff3d4ee4753705a048db1855113026395c26a79a" }, { "ImportPath": "github.com/fsouza/go-dockerclient/external/github.com/docker/go-units", - "Rev": "086d16d0c1428734a75065d2aa64e248093d2790" + "Rev": "ff3d4ee4753705a048db1855113026395c26a79a" }, { "ImportPath": "github.com/fsouza/go-dockerclient/external/github.com/hashicorp/go-cleanhttp", - "Rev": "086d16d0c1428734a75065d2aa64e248093d2790" + "Rev": "ff3d4ee4753705a048db1855113026395c26a79a" }, { "ImportPath": "github.com/fsouza/go-dockerclient/external/github.com/opencontainers/runc/libcontainer/user", - "Rev": "086d16d0c1428734a75065d2aa64e248093d2790" + "Rev": "ff3d4ee4753705a048db1855113026395c26a79a" }, { "ImportPath": "github.com/fsouza/go-dockerclient/external/golang.org/x/net/context", - "Rev": "086d16d0c1428734a75065d2aa64e248093d2790" + "Rev": "ff3d4ee4753705a048db1855113026395c26a79a" }, { "ImportPath": "github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix", - "Rev": "086d16d0c1428734a75065d2aa64e248093d2790" + "Rev": "ff3d4ee4753705a048db1855113026395c26a79a" }, { "ImportPath": "github.com/garyburd/redigo/internal", diff --git a/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/.travis.yml b/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/.travis.yml index a96df786..214cae59 100644 --- a/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/.travis.yml +++ b/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/.travis.yml @@ -1,25 +1,24 @@ language: go sudo: required go: - - 1.3.3 - 1.4.2 - - 1.5.3 - - 1.6 + - 1.5.4 + - 1.6.1 - tip +os: + - linux + - osx env: - - GOARCH=amd64 DOCKER_VERSION=1.7.1 - - GOARCH=386 DOCKER_VERSION=1.7.1 - - GOARCH=amd64 DOCKER_VERSION=1.8.3 - - GOARCH=386 DOCKER_VERSION=1.8.3 - GOARCH=amd64 DOCKER_VERSION=1.9.1 - GOARCH=386 DOCKER_VERSION=1.9.1 - GOARCH=amd64 DOCKER_VERSION=1.10.3 - GOARCH=386 DOCKER_VERSION=1.10.3 + - GOARCH=amd64 DOCKER_VERSION=1.11.0 + - GOARCH=386 DOCKER_VERSION=1.11.0 install: - - travis_retry make prepare_docker + - travis_retry travis-scripts/install.bash script: - travis-scripts/run-tests.bash - - DOCKER_HOST=tcp://127.0.0.1:2375 make integration services: - docker matrix: diff --git a/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/AUTHORS b/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/AUTHORS index bb71cc34..fa15cf96 100644 --- a/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/AUTHORS +++ b/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/AUTHORS @@ -101,6 +101,7 @@ Peter Jihoon Kim Phil Lu Philippe Lafoucrière Rafe Colton +Raphaël Pinson Rob Miller Robert Williamson Roman Khlystik @@ -109,6 +110,7 @@ Sam Rijs Sami Wagiaalla Samuel Archambault Samuel Karp +Seth Jennings Silas Sewell Simon Eskildsen Simon Menke diff --git a/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/Makefile b/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/Makefile index 86b7e0bb..dd8c73b1 100644 --- a/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/Makefile +++ b/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/Makefile @@ -28,7 +28,6 @@ lint: exit $${status:-0} vet: - @-go get -v golang.org/x/tools/cmd/vet $(foreach pkg,$(PKGS),go vet $(pkg);) fmt: @@ -39,15 +38,6 @@ fmtcheck: [ -n "$${output}" ] && echo "$${output}" && export status=1; \ exit $${status:-0} -prepare_docker: - sudo stop docker || true - sudo rm -rf /var/lib/docker - sudo rm -f `which docker` - sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D - echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" | sudo tee /etc/apt/sources.list.d/docker.list - sudo apt-get update - sudo apt-get install docker-engine=$(DOCKER_VERSION)-0~$(shell lsb_release -cs) -y --force-yes -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" - pretest: lint vet fmtcheck gotest: diff --git a/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/README.markdown b/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/README.markdown index b915039f..234b9e49 100644 --- a/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/README.markdown +++ b/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/README.markdown @@ -1,10 +1,11 @@ # go-dockerclient -[![Travis](https://img.shields.io/travis/fsouza/go-dockerclient.svg?style=flat-square)](https://travis-ci.org/fsouza/go-dockerclient) +[![Travis](https://img.shields.io/travis/fsouza/go-dockerclient/master.svg?style=flat-square)](https://travis-ci.org/fsouza/go-dockerclient) [![GoDoc](https://img.shields.io/badge/api-Godoc-blue.svg?style=flat-square)](https://godoc.org/github.com/fsouza/go-dockerclient) This package presents a client for the Docker remote API. It also provides support for the extensions in the [Swarm API](https://docs.docker.com/swarm/swarm-api/). +It currently supports the Docker API up to version 1.23. This package also provides support for docker's network API, which is a simple passthrough to the libnetwork remote API. Note that docker's network API is diff --git a/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/auth.go b/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/auth.go index 1be277c9..95596d78 100644 --- a/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/auth.go +++ b/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/auth.go @@ -11,6 +11,7 @@ import ( "errors" "fmt" "io" + "io/ioutil" "os" "path" "strings" @@ -122,17 +123,36 @@ func authConfigs(confs map[string]dockerConfig) (*AuthConfigurations, error) { return c, nil } +// AuthStatus returns the authentication status for Docker API versions >= 1.23. +type AuthStatus struct { + Status string `json:"Status,omitempty" yaml:"Status,omitempty"` + IdentityToken string `json:"IdentityToken,omitempty" yaml:"IdentityToken,omitempty"` +} + // AuthCheck validates the given credentials. It returns nil if successful. // -// See https://goo.gl/m2SleN for more details. -func (c *Client) AuthCheck(conf *AuthConfiguration) error { +// For Docker API versions >= 1.23, the AuthStatus struct will be populated, otherwise it will be empty.` +// +// See https://goo.gl/6nsZkH for more details. +func (c *Client) AuthCheck(conf *AuthConfiguration) (AuthStatus, error) { + var authStatus AuthStatus if conf == nil { - return fmt.Errorf("conf is nil") + return authStatus, fmt.Errorf("conf is nil") } resp, err := c.do("POST", "/auth", doOptions{data: conf}) if err != nil { - return err + return authStatus, err } - resp.Body.Close() - return nil + defer resp.Body.Close() + data, err := ioutil.ReadAll(resp.Body) + if err != nil { + return authStatus, err + } + if len(data) == 0 { + return authStatus, nil + } + if err := json.Unmarshal(data, &authStatus); err != nil { + return authStatus, err + } + return authStatus, nil } diff --git a/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/container.go b/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/container.go index c7531889..99db6855 100644 --- a/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/container.go +++ b/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/container.go @@ -14,6 +14,8 @@ import ( "strconv" "strings" "time" + + "github.com/fsouza/go-dockerclient/external/github.com/docker/go-units" ) // ErrContainerAlreadyExists is the error returned by CreateContainer when the @@ -40,6 +42,17 @@ type APIPort struct { IP string `json:"IP,omitempty" yaml:"IP,omitempty"` } +// APIMount represents a mount point for a container. +type APIMount struct { + Name string `json:"Name,omitempty" yaml:"Name,omitempty"` + Source string `json:"Source,omitempty" yaml:"Source,omitempty"` + Destination string `json:"Destination,omitempty" yaml:"Destination,omitempty"` + Driver string `json:"Driver,omitempty" yaml:"Driver,omitempty"` + Mode string `json:"Mode,omitempty" yaml:"Mode,omitempty"` + RW bool `json:"RW,omitempty" yaml:"RW,omitempty"` + Propogation string `json:"Propogation,omitempty" yaml:"Propogation,omitempty"` +} + // APIContainers represents each container in the list returned by // ListContainers. type APIContainers struct { @@ -47,6 +60,7 @@ type APIContainers struct { Image string `json:"Image,omitempty" yaml:"Image,omitempty"` Command string `json:"Command,omitempty" yaml:"Command,omitempty"` Created int64 `json:"Created,omitempty" yaml:"Created,omitempty"` + State string `json:"State,omitempty" yaml:"State,omitempty"` Status string `json:"Status,omitempty" yaml:"Status,omitempty"` Ports []APIPort `json:"Ports,omitempty" yaml:"Ports,omitempty"` SizeRw int64 `json:"SizeRw,omitempty" yaml:"SizeRw,omitempty"` @@ -54,6 +68,7 @@ type APIContainers struct { Names []string `json:"Names,omitempty" yaml:"Names,omitempty"` Labels map[string]string `json:"Labels,omitempty" yaml:"Labels,omitempty"` Networks NetworkList `json:"NetworkSettings,omitempty" yaml:"NetworkSettings,omitempty"` + Mounts []APIMount `json:"Mounts,omitempty" yaml:"Mounts,omitempty"` } // NetworkList encapsulates a map of networks, as returned by the Docker API in @@ -99,26 +114,73 @@ func (p Port) Proto() string { // State represents the state of a container. type State struct { - Running bool `json:"Running,omitempty" yaml:"Running,omitempty"` - Paused bool `json:"Paused,omitempty" yaml:"Paused,omitempty"` - Restarting bool `json:"Restarting,omitempty" yaml:"Restarting,omitempty"` - OOMKilled bool `json:"OOMKilled,omitempty" yaml:"OOMKilled,omitempty"` - Pid int `json:"Pid,omitempty" yaml:"Pid,omitempty"` - ExitCode int `json:"ExitCode,omitempty" yaml:"ExitCode,omitempty"` - Error string `json:"Error,omitempty" yaml:"Error,omitempty"` - StartedAt time.Time `json:"StartedAt,omitempty" yaml:"StartedAt,omitempty"` - FinishedAt time.Time `json:"FinishedAt,omitempty" yaml:"FinishedAt,omitempty"` + Status string `json:"Status,omitempty" yaml:"Status,omitempty"` + Running bool `json:"Running,omitempty" yaml:"Running,omitempty"` + Paused bool `json:"Paused,omitempty" yaml:"Paused,omitempty"` + Restarting bool `json:"Restarting,omitempty" yaml:"Restarting,omitempty"` + OOMKilled bool `json:"OOMKilled,omitempty" yaml:"OOMKilled,omitempty"` + RemovalInProgress bool `json:"RemovalInProgress,omitempty" yaml:"RemovalInProgress,omitempty"` + Dead bool `json:"Dead,omitempty" yaml:"Dead,omitempty"` + Pid int `json:"Pid,omitempty" yaml:"Pid,omitempty"` + ExitCode int `json:"ExitCode,omitempty" yaml:"ExitCode,omitempty"` + Error string `json:"Error,omitempty" yaml:"Error,omitempty"` + StartedAt time.Time `json:"StartedAt,omitempty" yaml:"StartedAt,omitempty"` + FinishedAt time.Time `json:"FinishedAt,omitempty" yaml:"FinishedAt,omitempty"` } -// String returns the string representation of a state. +// String returns a human-readable description of the state func (s *State) String() string { + if s.Running { + if s.Paused { + return fmt.Sprintf("Up %s (Paused)", units.HumanDuration(time.Now().UTC().Sub(s.StartedAt))) + } + if s.Restarting { + return fmt.Sprintf("Restarting (%d) %s ago", s.ExitCode, units.HumanDuration(time.Now().UTC().Sub(s.FinishedAt))) + } + + return fmt.Sprintf("Up %s", units.HumanDuration(time.Now().UTC().Sub(s.StartedAt))) + } + + if s.RemovalInProgress { + return "Removal In Progress" + } + + if s.Dead { + return "Dead" + } + + if s.StartedAt.IsZero() { + return "Created" + } + + if s.FinishedAt.IsZero() { + return "" + } + + return fmt.Sprintf("Exited (%d) %s ago", s.ExitCode, units.HumanDuration(time.Now().UTC().Sub(s.FinishedAt))) +} + +// StateString returns a single string to describe state +func (s *State) StateString() string { if s.Running { if s.Paused { return "paused" } - return fmt.Sprintf("Up %s", time.Now().UTC().Sub(s.StartedAt)) + if s.Restarting { + return "restarting" + } + return "running" } - return fmt.Sprintf("Exit %d", s.ExitCode) + + if s.Dead { + return "dead" + } + + if s.StartedAt.IsZero() { + return "created" + } + + return "exited" } // PortBinding represents the host/container port mapping as returned in the @@ -213,6 +275,7 @@ type Config struct { MemorySwap int64 `json:"MemorySwap,omitempty" yaml:"MemorySwap,omitempty"` MemoryReservation int64 `json:"MemoryReservation,omitempty" yaml:"MemoryReservation,omitempty"` KernelMemory int64 `json:"KernelMemory,omitempty" yaml:"KernelMemory,omitempty"` + PidsLimit int64 `json:"PidsLimit,omitempty" yaml:"PidsLimit,omitempty"` CPUShares int64 `json:"CpuShares,omitempty" yaml:"CpuShares,omitempty"` CPUSet string `json:"Cpuset,omitempty" yaml:"Cpuset,omitempty"` AttachStdin bool `json:"AttachStdin,omitempty" yaml:"AttachStdin,omitempty"` @@ -279,6 +342,12 @@ type SwarmNode struct { Labels map[string]string `json:"Labels,omitempty" yaml:"Labels,omitempty"` } +// GraphDriver contains information about the GraphDriver used by the container +type GraphDriver struct { + Name string `json:"Name,omitempty" yaml:"Name,omitempty"` + Data map[string]string `json:"Data,omitempty" yaml:"Data,omitempty"` +} + // Container is the type encompasing everything about a container - its config, // hostconfig, etc. type Container struct { @@ -306,10 +375,11 @@ type Container struct { Driver string `json:"Driver,omitempty" yaml:"Driver,omitempty"` Mounts []Mount `json:"Mounts,omitempty" yaml:"Mounts,omitempty"` - Volumes map[string]string `json:"Volumes,omitempty" yaml:"Volumes,omitempty"` - VolumesRW map[string]bool `json:"VolumesRW,omitempty" yaml:"VolumesRW,omitempty"` - HostConfig *HostConfig `json:"HostConfig,omitempty" yaml:"HostConfig,omitempty"` - ExecIDs []string `json:"ExecIDs,omitempty" yaml:"ExecIDs,omitempty"` + Volumes map[string]string `json:"Volumes,omitempty" yaml:"Volumes,omitempty"` + VolumesRW map[string]bool `json:"VolumesRW,omitempty" yaml:"VolumesRW,omitempty"` + HostConfig *HostConfig `json:"HostConfig,omitempty" yaml:"HostConfig,omitempty"` + ExecIDs []string `json:"ExecIDs,omitempty" yaml:"ExecIDs,omitempty"` + GraphDriver *GraphDriver `json:"GraphDriver,omitempty" yaml:"GraphDriver,omitempty"` RestartCount int `json:"RestartCount,omitempty" yaml:"RestartCount,omitempty"` @@ -320,16 +390,17 @@ type Container struct { // // See https://goo.gl/Y6fXUy for more details. type UpdateContainerOptions struct { - BlkioWeight int `json:"BlkioWeight"` - CPUShares int `json:"CpuShares"` - CPUPeriod int `json:"CpuPeriod"` - CPUQuota int `json:"CpuQuota"` - CpusetCpus string `json:"CpusetCpus"` - CpusetMems string `json:"CpusetMems"` - Memory int `json:"Memory"` - MemorySwap int `json:"MemorySwap"` - MemoryReservation int `json:"MemoryReservation"` - KernelMemory int `json:"KernelMemory"` + BlkioWeight int `json:"BlkioWeight"` + CPUShares int `json:"CpuShares"` + CPUPeriod int `json:"CpuPeriod"` + CPUQuota int `json:"CpuQuota"` + CpusetCpus string `json:"CpusetCpus"` + CpusetMems string `json:"CpusetMems"` + Memory int `json:"Memory"` + MemorySwap int `json:"MemorySwap"` + MemoryReservation int `json:"MemoryReservation"` + KernelMemory int `json:"KernelMemory"` + RestartPolicy RestartPolicy `json:"RestartPolicy,omitempty"` } // UpdateContainer updates the container at ID with the options @@ -541,6 +612,7 @@ type HostConfig struct { DNSSearch []string `json:"DnsSearch,omitempty" yaml:"DnsSearch,omitempty"` ExtraHosts []string `json:"ExtraHosts,omitempty" yaml:"ExtraHosts,omitempty"` VolumesFrom []string `json:"VolumesFrom,omitempty" yaml:"VolumesFrom,omitempty"` + UsernsMode string `json:"UsernsMode,omitempty" yaml:"UsernsMode,omitempty"` NetworkMode string `json:"NetworkMode,omitempty" yaml:"NetworkMode,omitempty"` IpcMode string `json:"IpcMode,omitempty" yaml:"IpcMode,omitempty"` PidMode string `json:"PidMode,omitempty" yaml:"PidMode,omitempty"` @@ -697,7 +769,10 @@ func (c *Client) TopContainer(id string, psArgs string) (TopResult, error) { // // See https://goo.gl/GNmLHb for more details. type Stats struct { - Read time.Time `json:"read,omitempty" yaml:"read,omitempty"` + Read time.Time `json:"read,omitempty" yaml:"read,omitempty"` + PidsStats struct { + Current uint64 `json:"current,omitempty" yaml:"current,omitempty"` + } `json:"pids_stats,omitempty" yaml:"pids_stats,omitempty"` Network NetworkStats `json:"network,omitempty" yaml:"network,omitempty"` Networks map[string]NetworkStats `json:"networks,omitempty" yaml:"networks,omitempty"` MemoryStats struct { diff --git a/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/image.go b/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/image.go index ca450635..fb265732 100644 --- a/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/image.go +++ b/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/image.go @@ -29,6 +29,12 @@ type APIImages struct { Labels map[string]string `json:"Labels,omitempty" yaml:"Labels,omitempty"` } +// RootFS represents the underlying layers used by an image +type RootFS struct { + Type string `json:"Type,omitempty" yaml:"Type,omitempty"` + Layers []string `json:"Layers,omitempty" yaml:"Layers,omitempty"` +} + // Image is the type representing a docker image and its various properties type Image struct { ID string `json:"Id" yaml:"Id"` @@ -45,6 +51,7 @@ type Image struct { Size int64 `json:"Size,omitempty" yaml:"Size,omitempty"` VirtualSize int64 `json:"VirtualSize,omitempty" yaml:"VirtualSize,omitempty"` RepoDigests []string `json:"RepoDigests,omitempty" yaml:"RepoDigests,omitempty"` + RootFS *RootFS `json:"RootFS,omitempty" yaml:"RootFS,omitempty"` } // ImagePre012 serves the same purpose as the Image type except that it is for @@ -585,10 +592,10 @@ type APIImageSearch struct { // See https://goo.gl/AYjyrF for more details. func (c *Client) SearchImages(term string) ([]APIImageSearch, error) { resp, err := c.do("GET", "/images/search?term="+term, doOptions{}) - defer resp.Body.Close() if err != nil { return nil, err } + defer resp.Body.Close() var searchResult []APIImageSearch if err := json.NewDecoder(resp.Body).Decode(&searchResult); err != nil { return nil, err diff --git a/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/network.go b/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/network.go index b72e91a0..22d6dbdb 100644 --- a/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/network.go +++ b/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/network.go @@ -28,6 +28,7 @@ type Network struct { Containers map[string]Endpoint Options map[string]string Internal bool + EnableIPv6 bool `json:"EnableIPv6"` } // Endpoint contains network resources allocated and used for a container in a network @@ -111,7 +112,9 @@ type CreateNetworkOptions struct { CheckDuplicate bool `json:"CheckDuplicate"` Driver string `json:"Driver"` IPAM IPAMOptions `json:"IPAM"` - Options map[string]interface{} `json:"options"` + Options map[string]interface{} `json:"Options"` + Internal bool `json:"Internal"` + EnableIPv6 bool `json:"EnableIPv6"` } // IPAMOptions controls IP Address Management when creating a network diff --git a/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/volume.go b/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/volume.go index 0e57cb12..5fe8ee3d 100644 --- a/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/volume.go +++ b/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/volume.go @@ -22,9 +22,10 @@ var ( // // See https://goo.gl/FZA4BK for more details. type Volume struct { - Name string `json:"Name" yaml:"Name"` - Driver string `json:"Driver,omitempty" yaml:"Driver,omitempty"` - Mountpoint string `json:"Mountpoint,omitempty" yaml:"Mountpoint,omitempty"` + Name string `json:"Name" yaml:"Name"` + Driver string `json:"Driver,omitempty" yaml:"Driver,omitempty"` + Mountpoint string `json:"Mountpoint,omitempty" yaml:"Mountpoint,omitempty"` + Labels map[string]string `json:"Labels,omitempty" yaml:"Labels,omitempty"` } // ListVolumesOptions specify parameters to the ListVolumes function.