update Godeps to get Labels in container

Signed-off-by: Victor Vieux <victorvieux@gmail.com>
This commit is contained in:
Victor Vieux 2015-04-23 15:41:30 -07:00
parent cf946d35f9
commit 4f6df9704f
5 changed files with 34 additions and 1 deletions

2
Godeps/Godeps.json generated
View File

@ -60,7 +60,7 @@
},
{
"ImportPath": "github.com/samalba/dockerclient",
"Rev": "c37a52f55ab5a9edb9ffd4cf6e78692962b29b8d"
"Rev": "8b9427265e82fddde577648b986fbe78d816b333"
},
{
"ImportPath": "github.com/samuel/go-zookeeper/zk",

View File

@ -310,6 +310,20 @@ func (client *DockerClient) StopAllMonitorStats() {
atomic.StoreInt32(&client.monitorStats, 0)
}
func (client *DockerClient) TagImage(nameOrID string, repo string, tag string, force bool) error {
v := url.Values{}
v.Set("repo", repo)
v.Set("tag", tag)
if force {
v.Set("force", "1")
}
uri := fmt.Sprintf("/%s/images/%s/tag?%s", APIVersion, nameOrID, v.Encode())
if _, err := client.doRequest("POST", uri, nil, nil); err != nil {
return err
}
return nil
}
func (client *DockerClient) Version() (*Version, error) {
uri := fmt.Sprintf("/%s/version", APIVersion)
data, err := client.doRequest("GET", uri, nil, nil)
@ -444,3 +458,9 @@ func (client *DockerClient) Exec(config *ExecConfig) (string, error) {
}
return createExecResp.Id, nil
}
func (client *DockerClient) RenameContainer(oldName string, newName string) error {
uri := fmt.Sprintf("/containers/%s/rename?name=%s", oldName, newName)
_, err := client.doRequest("POST", uri, nil, nil)
return err
}

View File

@ -24,6 +24,7 @@ type Client interface {
StopAllMonitorEvents()
StartMonitorStats(id string, cb StatCallback, ec chan error, args ...interface{})
StopAllMonitorStats()
TagImage(nameOrID string, repo string, tag string, force bool) error
Version() (*Version, error)
PullImage(name string, auth *AuthConfig) error
LoadImage(reader io.Reader) error
@ -32,4 +33,5 @@ type Client interface {
RemoveImage(name string) ([]*ImageDelete, error)
PauseContainer(name string) error
UnpauseContainer(name string) error
RenameContainer(oldName string, newName string) error
}

View File

@ -73,6 +73,11 @@ func (client *MockClient) StopAllMonitorEvents() {
client.Mock.Called()
}
func (client *MockClient) TagImage(nameOrID string, repo string, tag string, force bool) error {
args := client.Mock.Called(nameOrID, repo, tag, force)
return args.Error(0)
}
func (client *MockClient) StartMonitorStats(id string, cb dockerclient.StatCallback, ec chan error, args ...interface{}) {
client.Mock.Called(id, cb, ec, args)
}
@ -125,3 +130,8 @@ func (client *MockClient) Exec(config *dockerclient.ExecConfig) (string, error)
args := client.Mock.Called(config)
return args.String(0), args.Error(1)
}
func (client *MockClient) RenameContainer(oldName string, newName string) error {
args := client.Mock.Called(oldName, newName)
return args.Error(0)
}

View File

@ -130,6 +130,7 @@ type Container struct {
Ports []Port
SizeRw int64
SizeRootFs int64
Labels map[string]string
}
type Event struct {