From 9b62d4ffa39f7c042f94f9a3670cae2a816535da Mon Sep 17 00:00:00 2001 From: Daniel Nephin Date: Mon, 8 Jan 2018 14:32:39 -0500 Subject: [PATCH] Use errdefs instead of string contains for checking not found Signed-off-by: Daniel Nephin --- libcontainerd/client_daemon.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libcontainerd/client_daemon.go b/libcontainerd/client_daemon.go index 7508968fd5..0c0939df10 100644 --- a/libcontainerd/client_daemon.go +++ b/libcontainerd/client_daemon.go @@ -147,7 +147,7 @@ func (c *client) Restore(ctx context.Context, id string, attachStdio StdioCallba rio, err = attachStdio(io) return rio, err }) - if err != nil && !strings.Contains(err.Error(), "no running task found") { + if err != nil && !errdefs.IsNotFound(errors.Cause(err)) { return false, -1, err }