Remove container on load if it exited
If the shim gets sigkilled while containerd is down we need to be able to remove the container correctly so that it does not stay in a stopped state forever. Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/Sirupsen/logrus"
|
||||
@@ -200,7 +201,9 @@ func (c *container) readSpec() (*specs.PlatformSpec, error) {
|
||||
}
|
||||
|
||||
func (c *container) Delete() error {
|
||||
return os.RemoveAll(filepath.Join(c.root, c.id))
|
||||
err := os.RemoveAll(filepath.Join(c.root, c.id))
|
||||
exec.Command(c.runtime, "delete", c.id).Run()
|
||||
return err
|
||||
}
|
||||
|
||||
func (c *container) Processes() ([]Process, error) {
|
||||
|
Reference in New Issue
Block a user