Skip to content

Commit 29f052f

Browse files
Merge pull request #2318 from giuseppe/always-use-default-paths
types: Always apply rootless path defaults
2 parents cdf5683 + 5d76a2e commit 29f052f

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

types/options.go

+11-13
Original file line numberDiff line numberDiff line change
@@ -160,19 +160,17 @@ func loadStoreOptionsFromConfFile(storageConf string) (StoreOptions, error) {
160160
defaultRootlessGraphRoot = storageOpts.GraphRoot
161161
storageOpts = StoreOptions{}
162162
reloadConfigurationFileIfNeeded(storageConf, &storageOpts)
163-
if usePerUserStorage() {
164-
// If the file did not specify a graphroot or runroot,
165-
// set sane defaults so we don't try and use root-owned
166-
// directories
167-
if storageOpts.RunRoot == "" {
168-
storageOpts.RunRoot = defaultRootlessRunRoot
169-
}
170-
if storageOpts.GraphRoot == "" {
171-
if storageOpts.RootlessStoragePath != "" {
172-
storageOpts.GraphRoot = storageOpts.RootlessStoragePath
173-
} else {
174-
storageOpts.GraphRoot = defaultRootlessGraphRoot
175-
}
163+
// If the file did not specify a graphroot or runroot,
164+
// set sane defaults so we don't try and use root-owned
165+
// directories
166+
if storageOpts.RunRoot == "" {
167+
storageOpts.RunRoot = defaultRootlessRunRoot
168+
}
169+
if storageOpts.GraphRoot == "" {
170+
if storageOpts.RootlessStoragePath != "" {
171+
storageOpts.GraphRoot = storageOpts.RootlessStoragePath
172+
} else {
173+
storageOpts.GraphRoot = defaultRootlessGraphRoot
176174
}
177175
}
178176
}

0 commit comments

Comments
 (0)