summaryrefslogtreecommitdiff
path: root/libpod/runtime.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-04-26 11:16:27 -0700
committerGitHub <noreply@github.com>2019-04-26 11:16:27 -0700
commite8ede74f5ef7b0d044c5d5344186fb998f676cec (patch)
tree9ee3a51fc6c94b9913da7b6097b4a4960372c766 /libpod/runtime.go
parenta85155617fb1ed4248adb2169845f4a08ab88789 (diff)
parente05af783295c9f4a0b210c0e6d368cf8c6dfe7c6 (diff)
downloadpodman-e8ede74f5ef7b0d044c5d5344186fb998f676cec.tar.gz
podman-e8ede74f5ef7b0d044c5d5344186fb998f676cec.tar.bz2
podman-e8ede74f5ef7b0d044c5d5344186fb998f676cec.zip
Merge pull request #3019 from mheon/system_events
Add System event type and renumber, refresh events
Diffstat (limited to 'libpod/runtime.go')
-rw-r--r--libpod/runtime.go26
1 files changed, 14 insertions, 12 deletions
diff --git a/libpod/runtime.go b/libpod/runtime.go
index d03731284..69cc10389 100644
--- a/libpod/runtime.go
+++ b/libpod/runtime.go
@@ -2,7 +2,6 @@ package libpod
import (
"fmt"
- "github.com/containers/libpod/libpod/events"
"io/ioutil"
"os"
"path/filepath"
@@ -12,6 +11,7 @@ import (
"github.com/BurntSushi/toml"
is "github.com/containers/image/storage"
"github.com/containers/image/types"
+ "github.com/containers/libpod/libpod/events"
"github.com/containers/libpod/libpod/image"
"github.com/containers/libpod/libpod/lock"
"github.com/containers/libpod/pkg/firewall"
@@ -754,6 +754,17 @@ func makeRuntime(runtime *Runtime) (err error) {
if err != nil {
return err
}
+
+ defer func() {
+ if err != nil && store != nil {
+ // Don't forcibly shut down
+ // We could be opening a store in use by another libpod
+ _, err2 := store.Shutdown(false)
+ if err2 != nil {
+ logrus.Errorf("Error removing store for partially-created runtime: %s", err2)
+ }
+ }
+ }()
}
runtime.store = store
@@ -780,17 +791,6 @@ func makeRuntime(runtime *Runtime) (err error) {
runtime.eventer = eventer
ir.Eventer = eventer
- defer func() {
- if err != nil && store != nil {
- // Don't forcibly shut down
- // We could be opening a store in use by another libpod
- _, err2 := store.Shutdown(false)
- if err2 != nil {
- logrus.Errorf("Error removing store for partially-created runtime: %s", err2)
- }
- }
- }()
-
// Set up a storage service for creating container root filesystems from
// images
storageService, err := getStorageService(runtime.store)
@@ -1074,6 +1074,8 @@ func (r *Runtime) refresh(alivePath string) error {
}
defer file.Close()
+ r.newSystemEvent(events.Refresh)
+
return nil
}