diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2019-07-03 00:37:31 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-03 00:37:31 +0200 |
commit | 3fa818a036c4df4987abd2e790d5c9f5259ccfec (patch) | |
tree | 6b43a58782e8e73813fcea12dfba498a79f721ff /libpod/runtime.go | |
parent | 55e028a12ee003e057c65e376fe4b723d28ae52e (diff) | |
parent | d0a0a3fbd9ebb2942c761f14fc56f3a470ae1834 (diff) | |
download | podman-3fa818a036c4df4987abd2e790d5c9f5259ccfec.tar.gz podman-3fa818a036c4df4987abd2e790d5c9f5259ccfec.tar.bz2 podman-3fa818a036c4df4987abd2e790d5c9f5259ccfec.zip |
Merge pull request #3465 from baude/nostore
configure runtime without store
Diffstat (limited to 'libpod/runtime.go')
-rw-r--r-- | libpod/runtime.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libpod/runtime.go b/libpod/runtime.go index 02aa76731..e358fe4c4 100644 --- a/libpod/runtime.go +++ b/libpod/runtime.go @@ -125,6 +125,9 @@ type Runtime struct { // mechanism to read and write even logs eventer events.Eventer + + // noStore indicates whether we need to interact with a store or not + noStore bool } // RuntimeConfig contains configuration options used to set up the runtime @@ -784,11 +787,14 @@ func makeRuntime(ctx context.Context, runtime *Runtime) (err error) { var store storage.Store if os.Geteuid() != 0 { logrus.Debug("Not configuring container store") + } else if runtime.noStore { + logrus.Debug("No store required. Not opening container store.") } else { store, err = storage.GetStore(runtime.config.StorageConfig) if err != nil { return err } + err = nil defer func() { if err != nil && store != nil { @@ -1148,6 +1154,8 @@ func (r *Runtime) Shutdown(force bool) error { } var lastError error + // If no store was requested, it can bew nil and there is no need to + // attempt to shut it down if r.store != nil { if _, err := r.store.Shutdown(force); err != nil { lastError = errors.Wrapf(err, "Error shutting down container storage") |