Ensure volume path is set appropriately by default

There are some cases where we might not be properly adjusting the
volume path after setting the storage graph root. Ensure that we
always set volume path to be a child of graph root.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
This commit is contained in:
Matthew Heon 2019-02-26 15:39:13 -05:00
parent b8e6ef618b
commit 5511cdc487
1 changed files with 2 additions and 0 deletions

View File

@ -325,6 +325,7 @@ func GetDefaultStoreOptions() (storage.StoreOptions, string, error) {
defaultRootlessGraphRoot = storageOpts.GraphRoot
storageOpts = storage.StoreOptions{}
storage.ReloadConfigurationFile(storageConf, &storageOpts)
volumePath = filepath.Join(storageOpts.GraphRoot, "volumes")
}
if rootless.IsRootless() {
@ -351,6 +352,7 @@ func GetDefaultStoreOptions() (storage.StoreOptions, string, error) {
if storageOpts.GraphRoot == "" {
storageOpts.GraphRoot = defaultRootlessGraphRoot
}
volumePath = filepath.Join(storageOpts.GraphRoot, "volumes")
}
}
return storageOpts, volumePath, nil