mirror of
https://github.com/containerd/containerd.git
synced 2026-08-09 09:33:06 +00:00
Merge pull request #12065 from fidencio/topic/blockfile-ensure-loop-is-part-of-the-mount-options
blockfile: Ensure required options are always set
This commit is contained in:
@@ -23,6 +23,7 @@ import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"slices"
|
||||
|
||||
"github.com/containerd/containerd/v2/core/mount"
|
||||
"github.com/containerd/containerd/v2/core/snapshots"
|
||||
@@ -160,6 +161,10 @@ func NewSnapshotter(root string, opts ...Opt) (snapshots.Snapshotter, error) {
|
||||
config.mountOptions = []string{"loop"}
|
||||
}
|
||||
|
||||
if !slices.Contains(config.mountOptions, "loop") {
|
||||
config.mountOptions = append(config.mountOptions, "loop")
|
||||
}
|
||||
|
||||
ms, err := storage.NewMetaStore(filepath.Join(root, "metadata.db"))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
Reference in New Issue
Block a user