Merge pull request #2598 from Random-Liu/fix-state-error-handling

Fix `runc state` error handling.
This commit is contained in:
Phil Estes
2018-08-31 08:06:04 -07:00
committed by GitHub

View File

@@ -228,7 +228,7 @@ func (p *Init) Status(ctx context.Context) (string, error) {
defer p.mu.Unlock()
c, err := p.runtime.State(ctx, p.id)
if err != nil {
if os.IsNotExist(err) {
if strings.Contains(err.Error(), "does not exist") {
return "stopped", nil
}
return "", p.runtimeError(err, "OCI runtime state failed")