summaryrefslogtreecommitdiff
path: root/vendor/github.com/fsouza/go-dockerclient/plugin.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-06-24 16:52:02 +0200
committerGitHub <noreply@github.com>2019-06-24 16:52:02 +0200
commit72260a296c534950d9c899ee907e73b5dd0162f0 (patch)
treed9b33042a70c2d1e600c75855a29b3aa594aaab6 /vendor/github.com/fsouza/go-dockerclient/plugin.go
parentcf244d87cdb9b2cb0d8510b2ea392d928c1eb269 (diff)
parentd697456dc90adbaf68224ed7c115b38d5855e582 (diff)
downloadpodman-72260a296c534950d9c899ee907e73b5dd0162f0.tar.gz
podman-72260a296c534950d9c899ee907e73b5dd0162f0.tar.bz2
podman-72260a296c534950d9c899ee907e73b5dd0162f0.zip
Merge pull request #3414 from vrothberg/go-modules
Go modules
Diffstat (limited to 'vendor/github.com/fsouza/go-dockerclient/plugin.go')
-rw-r--r--vendor/github.com/fsouza/go-dockerclient/plugin.go13
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
}