1
0
Fork 0
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:
Brian Goff 2018-10-01 09:00:09 -07:00 committed by GitHub
commit 299015de40
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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
}