diff --git a/containerd-shim/main.go b/containerd-shim/main.go index c1b78ca..4ca4101 100644 --- a/containerd-shim/main.go +++ b/containerd-shim/main.go @@ -58,11 +58,9 @@ func main() { if err := p.Close(); err != nil { logrus.WithField("error", err).Error("shim: close stdio") } - if err := p.delete(); err != nil { - logrus.WithField("error", err).Error("shim: delete runtime state") - } }() if err := p.start(); err != nil { + p.delete() logrus.WithField("error", err).Error("shim: start process") return } @@ -117,6 +115,7 @@ func main() { } // runtime has exited so the shim can also exit if exitShim { + p.delete() p.Wait() return } diff --git a/supervisor/sort_test.go b/supervisor/sort_test.go index 905bce0..2fd8680 100644 --- a/supervisor/sort_test.go +++ b/supervisor/sort_test.go @@ -57,6 +57,10 @@ func (p *testProcess) Close() error { return nil } +func (p *testProcess) State() runtime.State { + return runtime.Running +} + func TestSortProcesses(t *testing.T) { p := []runtime.Process{ &testProcess{"ls"},