diff options
author | Matthew Heon <matthew.heon@gmail.com> | 2018-01-16 10:13:31 -0500 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2018-01-17 15:26:43 +0000 |
commit | aa20a25ca060f13faeca30337d4792c5a7f00aa0 (patch) | |
tree | bb3f19adfb967f5c225092e8dca154baf9e5768c /libpod/runtime.go | |
parent | b814a94c341306875e40b13e4fe7ebffb1b57f5d (diff) | |
download | podman-aa20a25ca060f13faeca30337d4792c5a7f00aa0.tar.gz podman-aa20a25ca060f13faeca30337d4792c5a7f00aa0.tar.bz2 podman-aa20a25ca060f13faeca30337d4792c5a7f00aa0.zip |
Address review comments
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
Closes: #229
Approved by: rhatdan
Diffstat (limited to 'libpod/runtime.go')
-rw-r--r-- | libpod/runtime.go | 7 |
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") } |