Restorefixforrunningcontainer
Signed-off-by: Rajasekaran <rajasec79@gmail.com>
This commit is contained in:
parent
8447547797
commit
77af09efd6
|
@ -3,6 +3,7 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
|
||||||
|
@ -59,6 +60,13 @@ func restoreContainer(context *cli.Context, spec *specs.LinuxSpec, config *confi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
options := criuOptions(context)
|
options := criuOptions(context)
|
||||||
|
status, err := container.Status()
|
||||||
|
if err != nil {
|
||||||
|
logrus.Error(err)
|
||||||
|
}
|
||||||
|
if status == libcontainer.Running {
|
||||||
|
fatal(fmt.Errorf("Container with id %s already running", context.GlobalString("id")))
|
||||||
|
}
|
||||||
// ensure that the container is always removed if we were the process
|
// ensure that the container is always removed if we were the process
|
||||||
// that created it.
|
// that created it.
|
||||||
defer func() {
|
defer func() {
|
||||||
|
|
Loading…
Reference in New Issue