Skip to content

Commit

Permalink
options: keep using vfs for old users
Browse files Browse the repository at this point in the history
There is no need for `vfs` to be the default storage driver since kernel
>= 5.13 supports `overlay` natively however there is use-case for users
who don't had any configs and they started using `vfs` in a default
manner following check is a hack to keep `buildah` and `podman` working
for such users.

See: #1571 for prior
discussions.

Signed-off-by: Aditya R <arajan@redhat.com>
  • Loading branch information
flouthoc committed May 24, 2023
1 parent 60e72ea commit 9342270
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions types/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -310,10 +310,16 @@ func getRootlessStorageOpts(rootlessUID int, systemOpts StoreOptions) (StoreOpti
}
if opts.GraphDriverName == "" {
if len(systemOpts.GraphDriverPriority) == 0 {
if canUseRootlessOverlay(opts.GraphRoot, opts.RunRoot) {
opts.GraphDriverName = overlayDriver
} else {
// Note: Stat check on `graphRoot/vfs` is a hack to prevent
// old users from breaking.
// Reason: There can be users who defaulted to `vfs` and have
// already generated working content with `vfs` driver in such
// case `storage` will not silently default to `overlay`.
_, err := os.Stat(filepath.Join(opts.GraphRoot, "vfs"))
if err == nil || !canUseRootlessOverlay(opts.GraphRoot, opts.RunRoot) {
opts.GraphDriverName = "vfs"
} else {
opts.GraphDriverName = overlayDriver
}
} else {
opts.GraphDriverPriority = systemOpts.GraphDriverPriority
Expand Down

0 comments on commit 9342270

Please sign in to comment.