1
0
Fork 0
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:
Lifubang 2018-09-20 14:16:30 +08:00
parent 8af91768c7
commit 73cf7dfe17

View file

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