summaryrefslogtreecommitdiff
path: root/libpod/pod.go
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@gmail.com>2018-07-31 09:26:06 -0400
committerAtomic Bot <atomic-devel@projectatomic.io>2018-07-31 14:19:50 +0000
commit1a439f9fcbbc6a2b509c1ca7e23207a07a652399 (patch)
tree5f02ab163d1cd99316cc29ca9cb5005c3bbcbce3 /libpod/pod.go
parent21f50b9f34298b456fe5e8d423e849999236828c (diff)
downloadpodman-1a439f9fcbbc6a2b509c1ca7e23207a07a652399.tar.gz
podman-1a439f9fcbbc6a2b509c1ca7e23207a07a652399.tar.bz2
podman-1a439f9fcbbc6a2b509c1ca7e23207a07a652399.zip
Ensure container and pod refresh picks up a State
refresh() is the only major command we had that did not perform a sync before running, and thus was not guaranteed to pick up a good copy of the state. Fix this by updating the state before a refresh(). Signed-off-by: Matthew Heon <matthew.heon@gmail.com> Closes: #1186 Approved by: rhatdan
Diffstat (limited to 'libpod/pod.go')
-rw-r--r--libpod/pod.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/libpod/pod.go b/libpod/pod.go
index 9ea1f058b..2ad4f7d0e 100644
--- a/libpod/pod.go
+++ b/libpod/pod.go
@@ -154,6 +154,11 @@ func (p *Pod) save() error {
// Refresh a pod's state after restart
func (p *Pod) refresh() error {
+ // Need to to an update from the DB to pull potentially-missing state
+ if err := p.runtime.state.UpdatePod(p); err != nil {
+ return err
+ }
+
if !p.valid {
return ErrPodRemoved
}