summaryrefslogtreecommitdiff
path: root/libpod/state.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2018-12-05 00:55:48 -0800
committerGitHub <noreply@github.com>2018-12-05 00:55:48 -0800
commit50e754cd579933ba887927f4ff05754ad926eb30 (patch)
tree29a5e5b28a89e0d23ae32cbf43a911fa6b9b8479 /libpod/state.go
parent320085a04d6db82421cf6c2870071ab2cb54d22b (diff)
parente3882cfa2d1329d44c8a580418ea1d56804b331d (diff)
downloadpodman-50e754cd579933ba887927f4ff05754ad926eb30.tar.gz
podman-50e754cd579933ba887927f4ff05754ad926eb30.tar.bz2
podman-50e754cd579933ba887927f4ff05754ad926eb30.zip
Merge pull request #1918 from mheon/use_db_paths
Use paths written in DB instead if they differ from our defaults
Diffstat (limited to 'libpod/state.go')
-rw-r--r--libpod/state.go26
1 files changed, 26 insertions, 0 deletions
diff --git a/libpod/state.go b/libpod/state.go
index 273e81318..06c2003d8 100644
--- a/libpod/state.go
+++ b/libpod/state.go
@@ -1,5 +1,15 @@
package libpod
+// DBConfig is a set of Libpod runtime configuration settings that are saved
+// in a State when it is first created, and can subsequently be retrieved.
+type DBConfig struct {
+ LibpodRoot string
+ LibpodTmp string
+ StorageRoot string
+ StorageTmp string
+ GraphDriver string
+}
+
// State is a storage backend for libpod's current state.
// A State is only initialized once per instance of libpod.
// As such, initialization methods for State implementations may safely assume
@@ -21,6 +31,22 @@ type State interface {
// Refresh clears container and pod states after a reboot
Refresh() error
+ // GetDBConfig retrieves several paths configured within the database
+ // when it was created - namely, Libpod root and tmp dirs, c/storage
+ // root and tmp dirs, and c/storage graph driver.
+ // This is not implemented by the in-memory state, as it has no need to
+ // validate runtime configuration.
+ GetDBConfig() (*DBConfig, error)
+
+ // ValidateDBConfig validates 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