diff --git a/pkg/storage/utils/decomposedfs/decomposedfs.go b/pkg/storage/utils/decomposedfs/decomposedfs.go index df17fdd5c2..fc6bef5f09 100644 --- a/pkg/storage/utils/decomposedfs/decomposedfs.go +++ b/pkg/storage/utils/decomposedfs/decomposedfs.go @@ -212,6 +212,9 @@ func New(o *options.Options, aspects aspects.Aspects) (storage.FS, error) { return nil, err } + if aspects.Trashbin == nil { + return nil, errors.New("need trashbin") + } // set a null usermapper if we don't have one if aspects.UserMapper == nil { aspects.UserMapper = &usermapper.NullMapper{} diff --git a/pkg/storage/utils/decomposedfs/testhelpers/helpers.go b/pkg/storage/utils/decomposedfs/testhelpers/helpers.go index 1aa49e7a7c..01a0445758 100644 --- a/pkg/storage/utils/decomposedfs/testhelpers/helpers.go +++ b/pkg/storage/utils/decomposedfs/testhelpers/helpers.go @@ -175,6 +175,7 @@ func NewTestEnv(config map[string]interface{}) (*TestEnv, error) { Lookup: lu, Tree: tree, Permissions: permissions.NewPermissions(pmock, permissionsSelector), + Trashbin: &decomposedfs.DecomposedfsTrashbin{}, } fs, err := decomposedfs.New(o, aspects) if err != nil { diff --git a/pkg/storage/utils/decomposedfs/upload_async_test.go b/pkg/storage/utils/decomposedfs/upload_async_test.go index 47ead74e84..708ac2a0f4 100644 --- a/pkg/storage/utils/decomposedfs/upload_async_test.go +++ b/pkg/storage/utils/decomposedfs/upload_async_test.go @@ -177,6 +177,7 @@ var _ = Describe("Async file uploads", Ordered, func() { Tree: tree, Permissions: permissions.NewPermissions(pmock, permissionsSelector), EventStream: stream.Chan{pub, con}, + Trashbin: &DecomposedfsTrashbin{}, } fs, err = New(o, aspects) Expect(err).ToNot(HaveOccurred()) diff --git a/pkg/storage/utils/decomposedfs/upload_test.go b/pkg/storage/utils/decomposedfs/upload_test.go index 3ae7033d26..b480331260 100644 --- a/pkg/storage/utils/decomposedfs/upload_test.go +++ b/pkg/storage/utils/decomposedfs/upload_test.go @@ -141,6 +141,7 @@ var _ = Describe("File uploads", func() { Lookup: lu, Tree: tree, Permissions: permissions.NewPermissions(pmock, permissionsSelector), + Trashbin: &decomposedfs.DecomposedfsTrashbin{}, } fs, err = decomposedfs.New(o, aspects) Expect(err).ToNot(HaveOccurred())