summaryrefslogtreecommitdiff
path: root/libpod/options.go
diff options
context:
space:
mode:
Diffstat (limited to 'libpod/options.go')
-rw-r--r--libpod/options.go14
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
}