mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #37888 from lifubang/renameimprove
oldName release too early when docker rename
This commit is contained in:
commit
299015de40
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