diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json index 58ac1e16357..5974a8919f4 100644 --- a/Godeps/Godeps.json +++ b/Godeps/Godeps.json @@ -416,8 +416,8 @@ }, { "ImportPath": "github.com/fsouza/go-dockerclient", - "Comment": "0.2.1-728-g1399676", - "Rev": "299d728486342c894e7fafd68e3a4b89623bef1d" + "Comment": "0.2.1-860-g25bc220", + "Rev": "25bc220b299845ae5489fd19bf89c5278864b050" }, { "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 597b849d4c3..6b9cd96aef7 100644 --- a/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/.travis.yml +++ b/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/.travis.yml @@ -3,8 +3,8 @@ sudo: required go: - 1.3.3 - 1.4.2 - - 1.5.2 - - 1.6beta1 + - 1.5.3 + - 1.6beta2 - tip env: - GOARCH=amd64 DOCKER_VERSION=1.7.1 diff --git a/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/AUTHORS b/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/AUTHORS index 3359e7288c3..988849612e9 100644 --- a/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/AUTHORS +++ b/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/AUTHORS @@ -12,6 +12,7 @@ Antonio Murdaca Artem Sidorenko Ben Marini Ben McCann +Ben Parees Benno van den Berg Brendan Fosberry Brian Lalor @@ -37,6 +38,7 @@ Dave Choi David Huie Dawn Chen Dinesh Subhraveti +Drew Wells Ed Elias G. Schneevoigt Erez Horev 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 fd13bc23f22..47da77dbeb3 100644 --- a/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/image.go +++ b/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/image.go @@ -410,6 +410,8 @@ type BuildImageOptions struct { Memory int64 `qs:"memory"` Memswap int64 `qs:"memswap"` CPUShares int64 `qs:"cpushares"` + CPUQuota int64 `qs:"cpuquota"` + CPUPeriod int64 `qs:"cpuperiod"` CPUSetCPUs string `qs:"cpusetcpus"` InputStream io.Reader `qs:"-"` OutputStream io.Writer `qs:"-"` 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 38b3432461c..30d54230a43 100644 --- a/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/network.go +++ b/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/network.go @@ -17,19 +17,20 @@ var ErrNetworkAlreadyExists = errors.New("network already exists") // Network represents a network. // -// See https://goo.gl/1kmPKZ for more details. +// See https://goo.gl/6GugX3 for more details. type Network struct { Name string ID string `json:"Id"` Scope string Driver string + IPAM IPAMOptions Containers map[string]Endpoint Options map[string]string } // Endpoint contains network resources allocated and used for a container in a network // -// See https://goo.gl/1kmPKZ for more details. +// See https://goo.gl/6GugX3 for more details. type Endpoint struct { Name string ID string `json:"EndpointID"` @@ -40,7 +41,7 @@ type Endpoint struct { // ListNetworks returns all networks. // -// See https://goo.gl/1kmPKZ for more details. +// See https://goo.gl/6GugX3 for more details. func (c *Client) ListNetworks() ([]Network, error) { resp, err := c.do("GET", "/networks", doOptions{}) if err != nil { @@ -56,7 +57,7 @@ func (c *Client) ListNetworks() ([]Network, error) { // NetworkInfo returns information about a network by its ID. // -// See https://goo.gl/1kmPKZ for more details. +// See https://goo.gl/6GugX3 for more details. func (c *Client) NetworkInfo(id string) (*Network, error) { path := "/networks/" + id resp, err := c.do("GET", path, doOptions{}) @@ -77,7 +78,7 @@ func (c *Client) NetworkInfo(id string) (*Network, error) { // CreateNetworkOptions specify parameters to the CreateNetwork function and // (for now) is the expected body of the "create network" http request message // -// See https://goo.gl/1kmPKZ for more details. +// See https://goo.gl/6GugX3 for more details. type CreateNetworkOptions struct { Name string `json:"Name"` CheckDuplicate bool `json:"CheckDuplicate"` @@ -107,7 +108,7 @@ type IPAMConfig struct { // CreateNetwork creates a new network, returning the network instance, // or an error in case of failure. // -// See https://goo.gl/1kmPKZ for more details. +// See https://goo.gl/6GugX3 for more details. func (c *Client) CreateNetwork(opts CreateNetworkOptions) (*Network, error) { resp, err := c.do( "POST", @@ -144,7 +145,7 @@ func (c *Client) CreateNetwork(opts CreateNetworkOptions) (*Network, error) { // RemoveNetwork removes a network or returns an error in case of failure. // -// See https://goo.gl/1kmPKZ for more details. +// See https://goo.gl/6GugX3 for more details. func (c *Client) RemoveNetwork(id string) error { resp, err := c.do("DELETE", "/networks/"+id, doOptions{}) if err != nil { @@ -159,14 +160,14 @@ func (c *Client) RemoveNetwork(id string) error { // NetworkConnectionOptions specify parameters to the ConnectNetwork and DisconnectNetwork function. // -// See https://goo.gl/1kmPKZ for more details. +// See https://goo.gl/6GugX3 for more details. type NetworkConnectionOptions struct { Container string } // ConnectNetwork adds a container to a network or returns an error in case of failure. // -// See https://goo.gl/1kmPKZ for more details. +// See https://goo.gl/6GugX3 for more details. func (c *Client) ConnectNetwork(id string, opts NetworkConnectionOptions) error { resp, err := c.do("POST", "/networks/"+id+"/connect", doOptions{data: opts}) if err != nil { @@ -181,7 +182,7 @@ func (c *Client) ConnectNetwork(id string, opts NetworkConnectionOptions) error // DisconnectNetwork removes a container from a network or returns an error in case of failure. // -// See https://goo.gl/1kmPKZ for more details. +// See https://goo.gl/6GugX3 for more details. func (c *Client) DisconnectNetwork(id string, opts NetworkConnectionOptions) error { resp, err := c.do("POST", "/networks/"+id+"/disconnect", doOptions{data: opts}) if err != nil { diff --git a/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/testing/server.go b/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/testing/server.go index 2c09f21c292..b16e713676e 100644 --- a/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/testing/server.go +++ b/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/testing/server.go @@ -38,6 +38,7 @@ var nameRegexp = regexp.MustCompile(`^[a-zA-Z0-9][a-zA-Z0-9_.-]+$`) // For more details on the remote API, check http://goo.gl/G3plxW. type DockerServer struct { containers []*docker.Container + uploadedFiles map[string]string execs []*docker.ExecInspect execMut sync.RWMutex cMut sync.RWMutex @@ -89,6 +90,7 @@ func NewServer(bind string, containerChan chan<- *docker.Container, hook func(*h execCallbacks: make(map[string]func()), statsCallbacks: make(map[string]func(string) docker.Stats), customHandlers: make(map[string]http.Handler), + uploadedFiles: make(map[string]string), cChan: containerChan, } server.buildMuxer() @@ -120,6 +122,7 @@ func (s *DockerServer) buildMuxer() { s.mux.Path("/containers/{id:.*}").Methods("DELETE").HandlerFunc(s.handlerWrapper(s.removeContainer)) s.mux.Path("/containers/{id:.*}/exec").Methods("POST").HandlerFunc(s.handlerWrapper(s.createExecContainer)) s.mux.Path("/containers/{id:.*}/stats").Methods("GET").HandlerFunc(s.handlerWrapper(s.statsContainer)) + s.mux.Path("/containers/{id:.*}/archive").Methods("PUT").HandlerFunc(s.handlerWrapper(s.uploadToContainer)) s.mux.Path("/exec/{id:.*}/resize").Methods("POST").HandlerFunc(s.handlerWrapper(s.resizeExecContainer)) s.mux.Path("/exec/{id:.*}/start").Methods("POST").HandlerFunc(s.handlerWrapper(s.startExecContainer)) s.mux.Path("/exec/{id:.*}/json").Methods("GET").HandlerFunc(s.handlerWrapper(s.inspectExecContainer)) @@ -440,8 +443,8 @@ func (s *DockerServer) createContainer(w http.ResponseWriter, r *http.Request) { s.cMut.Unlock() w.WriteHeader(http.StatusCreated) s.notify(&container) - var c = struct{ ID string }{ID: container.ID} - json.NewEncoder(w).Encode(c) + + json.NewEncoder(w).Encode(container) } func (s *DockerServer) generateID() string { @@ -503,6 +506,23 @@ func (s *DockerServer) statsContainer(w http.ResponseWriter, r *http.Request) { } } +func (s *DockerServer) uploadToContainer(w http.ResponseWriter, r *http.Request) { + id := mux.Vars(r)["id"] + container, _, err := s.findContainer(id) + if err != nil { + http.Error(w, err.Error(), http.StatusNotFound) + return + } + if !container.State.Running { + w.WriteHeader(http.StatusInternalServerError) + fmt.Fprintf(w, "Container %s is not running", id) + return + } + path := r.URL.Query().Get("path") + s.uploadedFiles[id] = path + w.WriteHeader(http.StatusOK) +} + func (s *DockerServer) topContainer(w http.ResponseWriter, r *http.Request) { id := mux.Vars(r)["id"] container, _, err := s.findContainer(id)