Fix error message for pause a restarting container
| ... | ... |
@@ -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 |
} |