Skip to content

Commit

Permalink
Move container rename and remove to engine-api
Browse files Browse the repository at this point in the history
Signed-off-by: Nishant Totla <[email protected]>
  • Loading branch information
nishanttotla committed Apr 14, 2016
1 parent 09deb06 commit 3680a71
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions cluster/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 3680a71

Please sign in to comment.