Fix rename error when sid is empty
Signed-off-by: Wang Xing <hzwangxing@corp.netease.com> Upstream-commit: b9ab129554084cf65b6ffcc89d09b5d82bc02459 Component: engine
This commit is contained in:
@@ -106,7 +106,7 @@ func (daemon *Daemon) ContainerRename(oldName, newName string) error {
|
||||
}()
|
||||
|
||||
sid = container.NetworkSettings.SandboxID
|
||||
if daemon.netController != nil {
|
||||
if sid != "" && daemon.netController != nil {
|
||||
sb, err = daemon.netController.SandboxByID(sid)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user