Browse code

Merge pull request #19952 from WeiZhang555/fix-err-restarting-1

Fix error message for pause a restarting container

Jess Frazelle authored on 2016/02/04 10:34:19
Showing 1 changed files
... ...
@@ -35,6 +35,11 @@ func (daemon *Daemon) containerPause(container *container.Container) error {
35 35
 		return derr.ErrorCodeAlreadyPaused.WithArgs(container.ID)
36 36
 	}
37 37
 
38
+	// We cannot Pause the container which is restarting
39
+	if container.Restarting {
40
+		return derr.ErrorCodeContainerRestarting.WithArgs(container.ID)
41
+	}
42
+
38 43
 	if err := daemon.execDriver.Pause(container.Command); err != nil {
39 44
 		return derr.ErrorCodeCantPause.WithArgs(container.ID, err)
40 45
 	}