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 7b84089
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions types/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,15 @@ func getRootlessStorageOpts(rootlessUID int, systemOpts StoreOptions) (StoreOpti
} else {
opts.GraphDriverName = "vfs"
}

// Note: This is hack is 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 {
opts.GraphDriverName = "vfs"
}
} else {
opts.GraphDriverPriority = systemOpts.GraphDriverPriority
}
Expand Down

0 comments on commit 7b84089

Please sign in to comment.