Skip to content

Commit

Permalink
Refuse to run on a non-shared or noop id cache
Browse files Browse the repository at this point in the history
  • Loading branch information
aduffeck committed Sep 10, 2024
1 parent 9a503b1 commit bb6c1da
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/storage/fs/posix/posix.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@ func New(m map[string]interface{}, stream events.Stream) (storage.FS, error) {
return nil, err
}

switch o.IDCache.Store {
case "", "memory", "noop":
return nil, fmt.Errorf("the posix driver requires a shared id cache, e.g. nats-js-kv or redis")
}

tp, err := tree.New(lu, bs, um, trashbin, o, stream, store.Create(
store.Store(o.IDCache.Store),
store.TTL(o.IDCache.TTL),
Expand Down
3 changes: 3 additions & 0 deletions pkg/storage/fs/posix/posix_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ var _ = Describe("Posix", func() {
"root": tmpRoot,
"share_folder": "/Shares",
"permissionssvc": "any",
"idcache": map[string]interface{}{
"cache_store": "nats-js-kv",
},
}
})

Expand Down

0 comments on commit bb6c1da

Please sign in to comment.