summaryrefslogtreecommitdiff
path: root/vendor/github.com/fsouza/go-dockerclient/image.go
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2021-03-26 11:23:46 -0400
committerDaniel J Walsh <dwalsh@redhat.com>2021-03-26 13:57:27 -0400
commitfc197fb4f5c0e0d90da39fe672bce7d145272415 (patch)
tree56913b09296f1116d7d22d1bb938eba55d14c700 /vendor/github.com/fsouza/go-dockerclient/image.go
parentfa6ba9b00fb5f77ead67b624be510ec50b2f4f5e (diff)
downloadpodman-fc197fb4f5c0e0d90da39fe672bce7d145272415.tar.gz
podman-fc197fb4f5c0e0d90da39fe672bce7d145272415.tar.bz2
podman-fc197fb4f5c0e0d90da39fe672bce7d145272415.zip
[NO TESTS NEEDED] Vendor in containers/buildah v1.20.0
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'vendor/github.com/fsouza/go-dockerclient/image.go')
-rw-r--r--vendor/github.com/fsouza/go-dockerclient/image.go13
1 files changed, 8 insertions, 5 deletions
diff --git a/vendor/github.com/fsouza/go-dockerclient/image.go b/vendor/github.com/fsouza/go-dockerclient/image.go
index 5f72d6645..83af56b94 100644
--- a/vendor/github.com/fsouza/go-dockerclient/image.go
+++ b/vendor/github.com/fsouza/go-dockerclient/image.go
@@ -138,7 +138,8 @@ type ImageHistory struct {
func (c *Client) ImageHistory(name string) ([]ImageHistory, error) {
resp, err := c.do(http.MethodGet, "/images/"+name+"/history", doOptions{})
if err != nil {
- if e, ok := err.(*Error); ok && e.Status == http.StatusNotFound {
+ var e *Error
+ if errors.As(err, &e) && e.Status == http.StatusNotFound {
return nil, ErrNoSuchImage
}
return nil, err
@@ -157,7 +158,8 @@ func (c *Client) ImageHistory(name string) ([]ImageHistory, error) {
func (c *Client) RemoveImage(name string) error {
resp, err := c.do(http.MethodDelete, "/images/"+name, doOptions{})
if err != nil {
- if e, ok := err.(*Error); ok && e.Status == http.StatusNotFound {
+ var e *Error
+ if errors.As(err, &e) && e.Status == http.StatusNotFound {
return ErrNoSuchImage
}
return err
@@ -184,7 +186,8 @@ func (c *Client) RemoveImageExtended(name string, opts RemoveImageOptions) error
uri := fmt.Sprintf("/images/%s?%s", name, queryString(&opts))
resp, err := c.do(http.MethodDelete, uri, doOptions{context: opts.Context})
if err != nil {
- if e, ok := err.(*Error); ok && e.Status == http.StatusNotFound {
+ var e *Error
+ if errors.As(err, &e) && e.Status == http.StatusNotFound {
return ErrNoSuchImage
}
return err
@@ -199,7 +202,8 @@ func (c *Client) RemoveImageExtended(name string, opts RemoveImageOptions) error
func (c *Client) InspectImage(name string) (*Image, error) {
resp, err := c.do(http.MethodGet, "/images/"+name+"/json", doOptions{})
if err != nil {
- if e, ok := err.(*Error); ok && e.Status == http.StatusNotFound {
+ var e *Error
+ if errors.As(err, &e) && e.Status == http.StatusNotFound {
return nil, ErrNoSuchImage
}
return nil, err
@@ -323,7 +327,6 @@ func (c *Client) PullImage(opts PullImageOptions, auth AuthConfiguration) error
return c.createImage(&opts, headers, nil, opts.OutputStream, opts.RawJSONStream, opts.InactivityTimeout, opts.Context)
}
-//nolint:golint
func (c *Client) createImage(opts interface{}, headers map[string]string, in io.Reader, w io.Writer, rawJSONStream bool, timeout time.Duration, context context.Context) error {
url, err := c.getPath("/images/create", opts)
if err != nil {