From 5448555b8fcd09c6fb7ea0d698c5d5cade9edc88 Mon Sep 17 00:00:00 2001 From: Roman Vanicek Date: Thu, 3 Oct 2024 19:24:22 +0200 Subject: [PATCH] Hack for noocache works use it only when the option is used --- main.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index fb43abc..fbec988 100644 --- a/main.go +++ b/main.go @@ -32,6 +32,7 @@ import ( "github.com/boltdb/bolt" "github.com/docker/go-plugins-helpers/volume" log "github.com/sirupsen/logrus" + "golang.org/x/exp/slices" ) type ofsVolume struct { @@ -411,7 +412,7 @@ func (d *ofsDriver) Mount(r *volume.MountRequest) (*volume.MountResponse, error) // mount.objectivefs process and the mount forever stays in startup state returning "Input/output error" // for any filesystem interaction from us or other tools. // HACK: Due to the bug we just wait a safe interval - if i == 0 { + if i == 0 && slices.Contains(v.Opts, "noocache") { time.Sleep(1000 * time.Millisecond) } if isObjfs, err := isObjectiveFsMount(mountPath); err == nil && isObjfs {