summaryrefslogtreecommitdiff
path: root/libpod/state.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/state.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/state.go')
-rw-r--r--libpod/state.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/libpod/state.go b/libpod/state.go
index 7f4efa21b..99e2435a2 100644
--- a/libpod/state.go
+++ b/libpod/state.go
@@ -38,6 +38,15 @@ type State interface {
// validate runtime configuration.
GetDBConfig() (*DBConfig, error)
+ // ValidateDBConfig ralidates the config in the given Runtime struct
+ // against paths stored in the configured database.
+ // Libpod root and tmp dirs and c/storage root and tmp dirs and graph
+ // driver are validated.
+ // This is not implemented by the in-memory state, as it has no need to
+ // validate runtime configuration that may change over multiple runs of
+ // the program.
+ ValidateDBConfig(runtime *Runtime) error
+
// SetNamespace() sets the namespace for the store, and will determine
// what containers are retrieved with container and pod retrieval calls.
// A namespace of "", the empty string, acts as no namespace, and