summaryrefslogtreecommitdiff
path: root/libpod/container_api.go
diff options
context:
space:
mode:
authoropenshift-ci[bot] <75433959+openshift-ci[bot]@users.noreply.github.com>2022-07-05 13:26:45 +0000
committerGitHub <noreply@github.com>2022-07-05 13:26:45 +0000
commit02179c5686d74ff4d73b022eec305de9415bd448 (patch)
treef9336771915eefda935cbd7204254766b2be56c2 /libpod/container_api.go
parent13479d457d34496b43027bc1d71cdb0891a8b738 (diff)
parentb9aa4755559d50d39bee3f571734a1e17c0f08b2 (diff)
downloadpodman-02179c5686d74ff4d73b022eec305de9415bd448.tar.gz
podman-02179c5686d74ff4d73b022eec305de9415bd448.tar.bz2
podman-02179c5686d74ff4d73b022eec305de9415bd448.zip
Merge pull request #14830 from vrothberg/fix-14761
Sync: handle exit file
Diffstat (limited to 'libpod/container_api.go')
-rw-r--r--libpod/container_api.go15
1 files changed, 2 insertions, 13 deletions
diff --git a/libpod/container_api.go b/libpod/container_api.go
index f35cce772..39303eef6 100644
--- a/libpod/container_api.go
+++ b/libpod/container_api.go
@@ -761,19 +761,8 @@ func (c *Container) Sync() error {
defer c.lock.Unlock()
}
- // 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, define.ContainerStateStopping) {
- oldState := c.state.State
- if err := c.ociRuntime.UpdateContainerStatus(c); err != nil {
- return err
- }
- // Only save back to DB if state changed
- if c.state.State != oldState {
- if err := c.save(); err != nil {
- return err
- }
- }
+ if err := c.syncContainer(); err != nil {
+ return err
}
defer c.newContainerEvent(events.Sync)