diff options
author | Matthew Heon <matthew.heon@gmail.com> | 2018-01-03 16:27:33 -0500 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2018-01-17 15:26:43 +0000 |
commit | b814a94c341306875e40b13e4fe7ebffb1b57f5d (patch) | |
tree | 17c50c84d51a57684fb5747b0ff88477a7776d79 /libpod/options.go | |
parent | 5696dfef6e57826f37624d98773286c89a5f005b (diff) | |
download | podman-b814a94c341306875e40b13e4fe7ebffb1b57f5d.tar.gz podman-b814a94c341306875e40b13e4fe7ebffb1b57f5d.tar.bz2 podman-b814a94c341306875e40b13e4fe7ebffb1b57f5d.zip |
Wire in logic for selecting backing state impl
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
Closes: #229
Approved by: rhatdan
Diffstat (limited to 'libpod/options.go')
-rw-r--r-- | libpod/options.go | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/libpod/options.go b/libpod/options.go index 4890c71ff..ca4d104df 100644 --- a/libpod/options.go +++ b/libpod/options.go @@ -81,15 +81,21 @@ func WithSignaturePolicy(path string) RuntimeOption { } } -// WithInMemoryState specifies that the runtime will be backed by an in-memory -// state only, and state will not persist after the runtime is shut down -func WithInMemoryState() RuntimeOption { +// WithStateType sets the backing state implementation for libpod +// Please note that information is not portable between backing states +// As such, if this differs between two libpods running on the same system, +// they will not share containers, and unspecified behavior may occur +func WithStateType(storeType RuntimeStateStore) RuntimeOption { return func(rt *Runtime) error { if rt.valid { return ErrRuntimeFinalized } - rt.config.InMemoryState = true + if storeType == InvalidStateStore { + return errors.Wrapf(ErrInvalidArg, "must provide a valid state store type") + } + + rt.config.StateType = storeType return nil } |