Fix error check.
authorTom Clegg <tom@curii.com>
Tue, 8 Aug 2023 14:18:29 +0000 (10:18 -0400)
committerTom Clegg <tom@curii.com>
Tue, 8 Aug 2023 14:18:29 +0000 (10:18 -0400)
refs #17244

Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom@curii.com>

lib/crunchrun/docker.go

index 1fd8c4fd256d65d5441f4567b311a07dcf3c318c..4f449133f3a18014500c0ebd7d0fd78ae8e3b6af 100644 (file)
@@ -199,7 +199,7 @@ func (e *dockerExecutor) Pid() int {
        ctx, cancel := context.WithDeadline(context.Background(), time.Now().Add(10*time.Second))
        defer cancel()
        ctr, err := e.dockerclient.ContainerInspect(ctx, e.containerID)
-       if err != nil && ctr.State != nil {
+       if err == nil && ctr.State != nil {
                return ctr.State.Pid
        } else {
                return 0