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:
Derek McGowan
2025-07-08 14:29:39 +00:00
committed by GitHub

View File

@@ -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