summaryrefslogtreecommitdiff
path: root/libpod/runtime.go
diff options
context:
space:
mode:
Diffstat (limited to 'libpod/runtime.go')
-rw-r--r--libpod/runtime.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/libpod/runtime.go b/libpod/runtime.go
index dc258ab4f..d0362ec79 100644
--- a/libpod/runtime.go
+++ b/libpod/runtime.go
@@ -191,13 +191,14 @@ func NewRuntime(options ...RuntimeOption) (runtime *Runtime, err error) {
runtime.netPlugin = netPlugin
// Set up the state
- if runtime.config.StateType == InMemoryStateStore {
+ switch runtime.config.StateType {
+ case InMemoryStateStore:
state, err := NewInMemoryState()
if err != nil {
return nil, err
}
runtime.state = state
- } else if runtime.config.StateType == SQLiteStateStore {
+ case SQLiteStateStore:
dbPath := filepath.Join(runtime.config.StaticDir, "sql_state.db")
specsDir := filepath.Join(runtime.config.StaticDir, "ocispec")
@@ -215,7 +216,7 @@ func NewRuntime(options ...RuntimeOption) (runtime *Runtime, err error) {
return nil, err
}
runtime.state = state
- } else {
+ default:
return nil, errors.Wrapf(ErrInvalidArg, "unrecognized state type passed")
}