From 3680a717a16b0522452750a76549a013d9072d1d Mon Sep 17 00:00:00 2001 From: Nishant Totla Date: Thu, 14 Apr 2016 15:57:26 -0700 Subject: [PATCH] Move container rename and remove to engine-api Signed-off-by: Nishant Totla --- cluster/engine.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/cluster/engine.go b/cluster/engine.go index 873750c3f1..b45a80d1f5 100644 --- a/cluster/engine.go +++ b/cluster/engine.go @@ -913,7 +913,12 @@ func (e *Engine) Create(config *ContainerConfig, name string, pullImage bool, au // RemoveContainer removes a container from the engine. func (e *Engine) RemoveContainer(container *Container, force, volumes bool) error { - err := e.client.RemoveContainer(container.ID, force, volumes) + opts := types.ContainerRemoveOptions{ + ContainerID: container.ID, + Force: force, + RemoveVolumes: volumes, + } + err := e.apiClient.ContainerRemove(context.TODO(), opts) e.CheckConnectionErr(err) if err != nil { return err @@ -1213,7 +1218,7 @@ func (e *Engine) StartContainer(id string, hostConfig *dockerclient.HostConfig) // RenameContainer renames a container func (e *Engine) RenameContainer(container *Container, newName string) error { // send rename request - err := e.client.RenameContainer(container.ID, newName) + err := e.apiClient.ContainerRename(context.TODO(), container.ID, newName) e.CheckConnectionErr(err) if err != nil { return err