summaryrefslogtreecommitdiff
path: root/libpod/runtime.go
diff options
context:
space:
mode:
authorMatthew Heon <mheon@redhat.com>2018-12-02 13:36:55 -0500
committerMatthew Heon <mheon@redhat.com>2018-12-02 13:38:36 -0500
commit137e0948aed96c3fe6412512e0d138eedf71d499 (patch)
tree24ca836a3fe6eaed4ab04dd568bc16d3b386a7c2 /libpod/runtime.go
parentb0f79ff4df58c12fdfaff5c4a7c6e029cb566459 (diff)
downloadpodman-137e0948aed96c3fe6412512e0d138eedf71d499.tar.gz
podman-137e0948aed96c3fe6412512e0d138eedf71d499.tar.bz2
podman-137e0948aed96c3fe6412512e0d138eedf71d499.zip
Make DB config validation an explicit step
Previously, we implicitly validated runtime configuration against what was stored in the database as part of database init. Make this an explicit step, so we can call it after the database has been initialized. This will allow us to retrieve paths from the database and use them to overwrite our defaults if they differ. Signed-off-by: Matthew Heon <mheon@redhat.com>
Diffstat (limited to 'libpod/runtime.go')
-rw-r--r--libpod/runtime.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/libpod/runtime.go b/libpod/runtime.go
index 8615e5e12..2e76f159b 100644
--- a/libpod/runtime.go
+++ b/libpod/runtime.go
@@ -448,6 +448,11 @@ func makeRuntime(runtime *Runtime) (err error) {
return errors.Wrapf(ErrInvalidArg, "unrecognized state type passed")
}
+ // Validate our config against the database
+ if err := runtime.state.ValidateDBConfig(runtime); err != nil {
+ return err
+ }
+
if err := runtime.state.SetNamespace(runtime.config.Namespace); err != nil {
return errors.Wrapf(err, "error setting libpod namespace in state")
}