Move container rename and remove to engine-api

Signed-off-by: Nishant Totla <nishanttotla@gmail.com>
This commit is contained in:
Nishant Totla 2016-04-14 15:57:26 -07:00
parent 09deb06382
commit 3680a717a1
No known key found for this signature in database
GPG Key ID: 7EA5781C9B3D0C19
1 changed files with 7 additions and 2 deletions

View File

@ -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