mirror of
https://github.com/containers/podman.git
synced 2025-07-15 03:02:52 +08:00
Wire in logic for selecting backing state impl
Signed-off-by: Matthew Heon <matthew.heon@gmail.com> Closes: #229 Approved by: rhatdan
This commit is contained in:
@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user