From a36006c2dcc40c62e05766e913cc8dc89602785c Mon Sep 17 00:00:00 2001 From: Matthew Heon Date: Wed, 2 Jan 2019 12:54:54 -0500 Subject: 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 --- libpod/runtime.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libpod/runtime.go b/libpod/runtime.go index 2dfebf565..f390824dc 100644 --- a/libpod/runtime.go +++ b/libpod/runtime.go @@ -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 != "" { -- cgit v1.2.3-54-g00ecf