diff options
author | Valentin Rothberg <rothberg@redhat.com> | 2019-06-24 11:29:13 +0200 |
---|---|---|
committer | Valentin Rothberg <rothberg@redhat.com> | 2019-06-24 13:20:59 +0200 |
commit | d697456dc90adbaf68224ed7c115b38d5855e582 (patch) | |
tree | 5fd88c48b34e7bead0028fa97e39f43f03880642 /vendor/github.com/fsouza/go-dockerclient/plugin.go | |
parent | a3211b73c62a9fcc13f09305bf629ef507b26d34 (diff) | |
download | podman-d697456dc90adbaf68224ed7c115b38d5855e582.tar.gz podman-d697456dc90adbaf68224ed7c115b38d5855e582.tar.bz2 podman-d697456dc90adbaf68224ed7c115b38d5855e582.zip |
migrate to go-modules
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
Diffstat (limited to 'vendor/github.com/fsouza/go-dockerclient/plugin.go')
-rw-r--r-- | vendor/github.com/fsouza/go-dockerclient/plugin.go | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/vendor/github.com/fsouza/go-dockerclient/plugin.go b/vendor/github.com/fsouza/go-dockerclient/plugin.go index 957015907..088790313 100644 --- a/vendor/github.com/fsouza/go-dockerclient/plugin.go +++ b/vendor/github.com/fsouza/go-dockerclient/plugin.go @@ -40,10 +40,10 @@ func (c *Client) InstallPlugins(opts InstallPluginOptions) error { data: opts.Plugins, context: opts.Context, }) - defer resp.Body.Close() if err != nil { return err } + resp.Body.Close() return nil } @@ -288,7 +288,6 @@ type EnablePluginOptions struct { func (c *Client) EnablePlugin(opts EnablePluginOptions) error { path := "/plugins/" + opts.Name + "/enable?" + queryString(opts) resp, err := c.do("POST", path, doOptions{context: opts.Context}) - defer resp.Body.Close() if err != nil { return err } @@ -312,7 +311,6 @@ type DisablePluginOptions struct { func (c *Client) DisablePlugin(opts DisablePluginOptions) error { path := "/plugins/" + opts.Name + "/disable" resp, err := c.do("POST", path, doOptions{context: opts.Context}) - defer resp.Body.Close() if err != nil { return err } @@ -339,11 +337,12 @@ func (c *Client) CreatePlugin(opts CreatePluginOptions) (string, error) { path := "/plugins/create?" + queryString(opts) resp, err := c.do("POST", path, doOptions{ data: opts.Path, - context: opts.Context}) - defer resp.Body.Close() + context: opts.Context, + }) if err != nil { return "", err } + defer resp.Body.Close() containerNameBytes, err := ioutil.ReadAll(resp.Body) if err != nil { return "", err @@ -367,10 +366,10 @@ type PushPluginOptions struct { func (c *Client) PushPlugin(opts PushPluginOptions) error { path := "/plugins/" + opts.Name + "/push" resp, err := c.do("POST", path, doOptions{context: opts.Context}) - defer resp.Body.Close() if err != nil { return err } + resp.Body.Close() return nil } @@ -394,13 +393,13 @@ func (c *Client) ConfigurePlugin(opts ConfigurePluginOptions) error { data: opts.Envs, context: opts.Context, }) - defer resp.Body.Close() if err != nil { if e, ok := err.(*Error); ok && e.Status == http.StatusNotFound { return &NoSuchPlugin{ID: opts.Name} } return err } + resp.Body.Close() return nil } |