summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Heon <mheon@redhat.com>2019-07-23 10:01:12 -0400
committerMatthew Heon <mheon@redhat.com>2019-07-23 13:30:30 -0400
commit5fb4feb36a2378298d54b00150add1097a6acb4c (patch)
treeb0e78e9056cab2cf838518e26e9e26bd452a5606
parentbb253af3fdc9928388bab1fb2063e7d0b79a5e4b (diff)
downloadpodman-5fb4feb36a2378298d54b00150add1097a6acb4c.tar.gz
podman-5fb4feb36a2378298d54b00150add1097a6acb4c.tar.bz2
podman-5fb4feb36a2378298d54b00150add1097a6acb4c.zip
Fix a segfault on Podman no-store commands with refresh
When a command (like `ps`) requests no store be created, but also requires a refresh be performed, we have to ignore its request and initialize the store anyways to prevent segfaults. This work was done in #3532, but that missed one thing - initializing a storage service. Without the storage service, Podman will still segfault. Fix that oversight here. Fixes #3625 Signed-off-by: Matthew Heon <mheon@redhat.com>
-rw-r--r--libpod/runtime.go16
1 files changed, 8 insertions, 8 deletions
diff --git a/libpod/runtime.go b/libpod/runtime.go
index 08c6cb588..28958e932 100644
--- a/libpod/runtime.go
+++ b/libpod/runtime.go
@@ -879,14 +879,6 @@ func makeRuntime(ctx context.Context, runtime *Runtime) (err error) {
runtime.imageRuntime.Eventer = eventer
}
- // Set up a storage service for creating container root filesystems from
- // images
- storageService, err := getStorageService(runtime.store)
- if err != nil {
- return err
- }
- runtime.storageService = storageService
-
// Set up containers/image
runtime.imageContext = &types.SystemContext{
SignaturePolicyPath: runtime.config.SignaturePolicyPath,
@@ -1330,6 +1322,14 @@ func (r *Runtime) configureStore() error {
r.store = store
is.Transport.SetStore(store)
+ // Set up a storage service for creating container root filesystems from
+ // images
+ storageService, err := getStorageService(r.store)
+ if err != nil {
+ return err
+ }
+ r.storageService = storageService
+
ir := image.NewImageRuntimeFromStore(r.store)
ir.SignaturePolicyPath = r.config.SignaturePolicyPath
ir.EventsLogFilePath = r.config.EventsLogFilePath