Warn on overriding user-specified storage driver w/ DB

Overriding storage.conf is not intuitive behavior, so pop up an
error message when it happens, so people know that bad things are
happening.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
This commit is contained in:
Matthew Heon
2019-01-02 12:54:54 -05:00
parent e796f522f6
commit a36006c2dc

View File

@ -511,6 +511,11 @@ func makeRuntime(runtime *Runtime) (err error) {
// Reset defaults if they were not explicitly set
if !runtime.configuredFrom.storageGraphDriverSet && dbConfig.GraphDriver != "" {
if runtime.config.StorageConfig.GraphDriverName != dbConfig.GraphDriver &&
runtime.config.StorageConfig.GraphDriverName != "" {
logrus.Errorf("User-selected graph driver %s overwritten by graph driver %s from database - delete libpod local files to resolve",
runtime.config.StorageConfig.GraphDriverName, dbConfig.GraphDriver)
}
runtime.config.StorageConfig.GraphDriverName = dbConfig.GraphDriver
}
if !runtime.configuredFrom.storageGraphRootSet && dbConfig.StorageRoot != "" {