From b9c8b5baf417a4bd1c68e031fe9d48d4fcc2c627 Mon Sep 17 00:00:00 2001 From: Darren Shepherd Date: Thu, 19 Feb 2015 08:33:19 -0700 Subject: [PATCH] Fix rename container in docker client --- Godeps/Godeps.json | 2 +- .../github.com/fsouza/go-dockerclient/container.go | 13 +++++-------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json index ec290a9d..350d1b84 100644 --- a/Godeps/Godeps.json +++ b/Godeps/Godeps.json @@ -137,7 +137,7 @@ }, { "ImportPath": "github.com/fsouza/go-dockerclient", - "Rev": "c726ee4dd0cdd42a8dd8397d005698d2e881460d" + "Rev": "d7ce918e02502d8f1b539703ef308977364385c6" }, { "ImportPath": "github.com/kless/term", diff --git a/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/container.go b/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/container.go index db69773c..7c402fa9 100644 --- a/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/container.go +++ b/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/container.go @@ -226,15 +226,12 @@ type Container struct { } // See for more details. -func (c *Client) RenameContainer(id string, name string) error { - qs := struct { - new_name string +func (c *Client) RenameContainer(id string, newName string) error { + _, _, err := c.do("POST", fmt.Sprintf("/containers/"+id+"/rename?%s", queryString(struct { + Name string `json:"name,omitempty"` }{ - new_name: name, - } - - _, _, err := c.do("POST", fmt.Sprintf("/containers/"+id+"/rename?%s", - queryString(qs)), nil) + Name: newName, + })), nil) return err }