mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
docker rename enhancement
Signed-off-by: Lifubang <lifubang@acmcoder.com>
This commit is contained in:
parent
8af91768c7
commit
73cf7dfe17
1 changed files with 2 additions and 1 deletions
|
@ -74,6 +74,8 @@ func (daemon *Daemon) ContainerRename(oldName, newName string) error {
|
|||
daemon.containersReplica.ReleaseName(newName + k)
|
||||
}
|
||||
daemon.releaseName(newName)
|
||||
} else {
|
||||
daemon.releaseName(oldName)
|
||||
}
|
||||
}()
|
||||
|
||||
|
@ -81,7 +83,6 @@ func (daemon *Daemon) ContainerRename(oldName, newName string) error {
|
|||
daemon.linkIndex.unlink(oldName+k, v, container)
|
||||
daemon.containersReplica.ReleaseName(oldName + k)
|
||||
}
|
||||
daemon.releaseName(oldName)
|
||||
if err = container.CheckpointTo(daemon.containersReplica); err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue