Explorar el Código

Merge pull request #35959 from dnephin/remove-str-error-checking

Use errdefs instead of string contains for checking not found
Brian Goff hace 7 años
padre
commit
7f6fdce901
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      libcontainerd/client_daemon.go

+ 1 - 1
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
 	}