summaryrefslogtreecommitdiff
path: root/libpod/container_api.go
diff options
context:
space:
mode:
authorMatthew Heon <mheon@redhat.com>2021-10-06 11:17:43 -0400
committerMatthew Heon <mheon@redhat.com>2021-10-06 11:19:32 -0400
commit8bd9f58d1d0db76406dca53907095648f4091f9f (patch)
treee01204cca664c9e2ca860d12fbcbbbb9faa942de /libpod/container_api.go
parente1089e89d7b8f5204ccb226934e46df736af4925 (diff)
downloadpodman-8bd9f58d1d0db76406dca53907095648f4091f9f.tar.gz
podman-8bd9f58d1d0db76406dca53907095648f4091f9f.tar.bz2
podman-8bd9f58d1d0db76406dca53907095648f4091f9f.zip
Ensure `podman ps --sync` functions
The backend for `ps --sync` has been nonfunctional for a long while now - probably since v2.0. It's questionable how useful the flag is in modern Podman (the original case it was intended to catch, Conmon gone via SIGKILL, should be handled now via pinging the process with a signal to ensure it's still alive) but having the ability to force a refresh of container state from the OCI runtime is still useful. Signed-off-by: Matthew Heon <mheon@redhat.com>
Diffstat (limited to 'libpod/container_api.go')
-rw-r--r--libpod/container_api.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/libpod/container_api.go b/libpod/container_api.go
index ecb307a5d..38223316e 100644
--- a/libpod/container_api.go
+++ b/libpod/container_api.go
@@ -690,7 +690,7 @@ func (c *Container) Sync() error {
// If runtime knows about the container, update its status in runtime
// And then save back to disk
- if c.ensureState(define.ContainerStateCreated, define.ContainerStateRunning, define.ContainerStatePaused, define.ContainerStateStopped) {
+ if c.ensureState(define.ContainerStateCreated, define.ContainerStateRunning, define.ContainerStatePaused, define.ContainerStateStopped, define.ContainerStateStopping) {
oldState := c.state.State
if err := c.ociRuntime.UpdateContainerStatus(c); err != nil {
return err