bump(github.com/fsouza/go-dockerclient): 17d39bcb22e8103ba6d1c0cb2530c6434cb870a3

This commit is contained in:
Paul Weil
2015-04-10 16:05:43 -04:00
parent 1db1894850
commit fb63370451
20 changed files with 864 additions and 131 deletions

View File

@@ -1,4 +1,4 @@
// Copyright 2014 go-dockerclient authors. All rights reserved.
// Copyright 2015 go-dockerclient authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
@@ -99,7 +99,7 @@ var (
// See http://goo.gl/2rOLFF for more details.
func (c *Client) ListImages(opts ListImagesOptions) ([]APIImages, error) {
path := "/images/json?" + queryString(opts)
body, _, err := c.do("GET", path, nil)
body, _, err := c.do("GET", path, nil, false)
if err != nil {
return nil, err
}
@@ -115,7 +115,7 @@ func (c *Client) ListImages(opts ListImagesOptions) ([]APIImages, error) {
//
// See http://goo.gl/2oJmNs for more details.
func (c *Client) ImageHistory(name string) ([]ImageHistory, error) {
body, status, err := c.do("GET", "/images/"+name+"/history", nil)
body, status, err := c.do("GET", "/images/"+name+"/history", nil, false)
if status == http.StatusNotFound {
return nil, ErrNoSuchImage
}
@@ -134,7 +134,29 @@ func (c *Client) ImageHistory(name string) ([]ImageHistory, error) {
//
// See http://goo.gl/znj0wM for more details.
func (c *Client) RemoveImage(name string) error {
_, status, err := c.do("DELETE", "/images/"+name, nil)
_, status, err := c.do("DELETE", "/images/"+name, nil, false)
if status == http.StatusNotFound {
return ErrNoSuchImage
}
return err
}
// RemoveImageOptions present the set of options available for removing an image
// from a registry.
//
// See http://goo.gl/6V48bF for more details.
type RemoveImageOptions struct {
Force bool `qs:"force"`
NoPrune bool `qs:"noprune"`
}
// RemoveImageExtended removes an image by its name or ID.
// Extra params can be passed, see RemoveImageOptions
//
// See http://goo.gl/znj0wM for more details.
func (c *Client) RemoveImageExtended(name string, opts RemoveImageOptions) error {
uri := fmt.Sprintf("/images/%s?%s", name, queryString(&opts))
_, status, err := c.do("DELETE", uri, nil, false)
if status == http.StatusNotFound {
return ErrNoSuchImage
}
@@ -145,7 +167,7 @@ func (c *Client) RemoveImage(name string) error {
//
// See http://goo.gl/Q112NY for more details.
func (c *Client) InspectImage(name string) (*Image, error) {
body, status, err := c.do("GET", "/images/"+name+"/json", nil)
body, status, err := c.do("GET", "/images/"+name+"/json", nil, false)
if status == http.StatusNotFound {
return nil, ErrNoSuchImage
}
@@ -156,7 +178,7 @@ func (c *Client) InspectImage(name string) (*Image, error) {
var image Image
// if the caller elected to skip checking the server's version, assume it's the latest
if c.SkipServerVersionCheck || c.expectedAPIVersion.GreaterThanOrEqualTo(apiVersion1_12) {
if c.SkipServerVersionCheck || c.expectedAPIVersion.GreaterThanOrEqualTo(apiVersion112) {
err = json.Unmarshal(body, &image)
if err != nil {
return nil, err
@@ -201,21 +223,6 @@ type PushImageOptions struct {
RawJSONStream bool `qs:"-"`
}
// AuthConfiguration represents authentication options to use in the PushImage
// method. It represents the authentication in the Docker index server.
type AuthConfiguration struct {
Username string `json:"username,omitempty"`
Password string `json:"password,omitempty"`
Email string `json:"email,omitempty"`
ServerAddress string `json:"serveraddress,omitempty"`
}
// AuthConfigurations represents authentication options to use for the
// PushImage method accommodating the new X-Registry-Config header
type AuthConfigurations struct {
Configs map[string]AuthConfiguration `json:"configs"`
}
// PushImage pushes an image to a remote registry, logging progress to w.
//
// An empty instance of AuthConfiguration may be used for unauthenticated
@@ -245,7 +252,7 @@ type PullImageOptions struct {
RawJSONStream bool `qs:"-"`
}
// PullImage pulls an image from a remote registry, logging progress to w.
// PullImage pulls an image from a remote registry, logging progress to opts.OutputStream.
//
// See http://goo.gl/ACyYNS for more details.
func (c *Client) PullImage(opts PullImageOptions, auth AuthConfiguration) error {
@@ -333,6 +340,7 @@ func (c *Client) ImportImage(opts ImportImageOptions) error {
// http://goo.gl/tlPXPu.
type BuildImageOptions struct {
Name string `qs:"t"`
Dockerfile string `qs:"dockerfile"`
NoCache bool `qs:"nocache"`
SuppressOutput bool `qs:"q"`
RmTmpContainer bool `qs:"rm"`
@@ -395,7 +403,8 @@ func (c *Client) TagImage(name string, opts TagImageOptions) error {
return ErrNoSuchImage
}
_, status, err := c.do("POST", fmt.Sprintf("/images/"+name+"/tag?%s",
queryString(&opts)), nil)
queryString(&opts)), nil, false)
if status == http.StatusNotFound {
return ErrNoSuchImage
}
@@ -445,7 +454,7 @@ type APIImageSearch struct {
//
// See http://goo.gl/xI5lLZ for more details.
func (c *Client) SearchImages(term string) ([]APIImageSearch, error) {
body, _, err := c.do("GET", "/images/search?term="+term, nil)
body, _, err := c.do("GET", "/images/search?term="+term, nil, false)
if err != nil {
return nil, err
}