summaryrefslogtreecommitdiff
path: root/libpod/container_api.go
diff options
context:
space:
mode:
Diffstat (limited to 'libpod/container_api.go')
-rw-r--r--libpod/container_api.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/libpod/container_api.go b/libpod/container_api.go
index dbd5fc1fb..742eb6d3e 100644
--- a/libpod/container_api.go
+++ b/libpod/container_api.go
@@ -551,6 +551,10 @@ func (c *Container) WaitForExit(ctx context.Context, pollInterval time.Duration)
exitCode, err := c.runtime.state.GetContainerExitCode(id)
if err != nil {
+ if errors.Is(err, define.ErrNoSuchExitCode) && c.ensureState(define.ContainerStateConfigured, define.ContainerStateCreated) {
+ // The container never ran.
+ return true, 0, nil
+ }
return true, -1, err
}