Prechádzať zdrojové kódy

Fix bug on LXC container start. Fixes #5718
Docker-DCO-1.1-Signed-off-by: Fernando Mayo <fernando@tutum.co> (github: fermayo)

Fernando 11 rokov pred
rodič
commit
752c57ae56
1 zmenil súbory, kde vykonal 5 pridanie a 9 odobranie
  1. 5 9
      daemon/execdriver/lxc/driver.go

+ 5 - 9
daemon/execdriver/lxc/driver.go

@@ -268,18 +268,14 @@ func (d *driver) waitForStart(c *execdriver.Command, waitLock chan struct{}) (in
 		}
 		}
 
 
 		output, err = d.getInfo(c.ID)
 		output, err = d.getInfo(c.ID)
-		if err != nil {
-			output, err = d.getInfo(c.ID)
+		if err == nil {
+			info, err := parseLxcInfo(string(output))
 			if err != nil {
 			if err != nil {
 				return -1, err
 				return -1, err
 			}
 			}
-		}
-		info, err := parseLxcInfo(string(output))
-		if err != nil {
-			return -1, err
-		}
-		if info.Running {
-			return info.Pid, nil
+			if info.Running {
+				return info.Pid, nil
+			}
 		}
 		}
 		time.Sleep(50 * time.Millisecond)
 		time.Sleep(50 * time.Millisecond)
 	}
 	}