mirror of
https://github.com/containers/podman.git
synced 2025-10-20 20:54:45 +08:00
Fix libpod static dir selection when graphroot changed
When graphroot is set by the user, we should set libpod's static directory to a subdirectory of that by default, to duplicate previous behavior. Signed-off-by: Matthew Heon <mheon@redhat.com>
This commit is contained in:
@ -37,6 +37,11 @@ func WithStorageConfig(config storage.StoreOptions) RuntimeOption {
|
|||||||
if config.GraphRoot != "" {
|
if config.GraphRoot != "" {
|
||||||
rt.config.StorageConfig.GraphRoot = config.GraphRoot
|
rt.config.StorageConfig.GraphRoot = config.GraphRoot
|
||||||
rt.configuredFrom.storageGraphRootSet = true
|
rt.configuredFrom.storageGraphRootSet = true
|
||||||
|
|
||||||
|
// Also set libpod static dir, so we are a subdirectory
|
||||||
|
// of the c/storage store by default
|
||||||
|
rt.config.StaticDir = filepath.Join(config.GraphRoot, "libpod")
|
||||||
|
rt.configuredFrom.libpodStaticDirSet = true
|
||||||
}
|
}
|
||||||
|
|
||||||
if config.GraphDriverName != "" {
|
if config.GraphDriverName != "" {
|
||||||
@ -44,13 +49,6 @@ func WithStorageConfig(config storage.StoreOptions) RuntimeOption {
|
|||||||
rt.configuredFrom.storageGraphDriverSet = true
|
rt.configuredFrom.storageGraphDriverSet = true
|
||||||
}
|
}
|
||||||
|
|
||||||
// Only set our static dir if it was not already explicitly
|
|
||||||
// overridden
|
|
||||||
if config.GraphRoot != "" && !rt.configuredFrom.libpodStaticDirSet {
|
|
||||||
rt.config.StaticDir = filepath.Join(config.GraphRoot, "libpod")
|
|
||||||
rt.configuredFrom.libpodStaticDirSet = true
|
|
||||||
}
|
|
||||||
|
|
||||||
if config.GraphDriverOptions != nil {
|
if config.GraphDriverOptions != nil {
|
||||||
rt.config.StorageConfig.GraphDriverOptions = make([]string, len(config.GraphDriverOptions))
|
rt.config.StorageConfig.GraphDriverOptions = make([]string, len(config.GraphDriverOptions))
|
||||||
copy(rt.config.StorageConfig.GraphDriverOptions, config.GraphDriverOptions)
|
copy(rt.config.StorageConfig.GraphDriverOptions, config.GraphDriverOptions)
|
||||||
|
Reference in New Issue
Block a user