From b51cae14baf28f236e0cd152206dad5e0f2136b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Duffeck?= Date: Fri, 21 Jun 2024 13:32:11 +0200 Subject: [PATCH] Onle enable fs-watching for the storageprovider, not the dataprovider We need to make sure that the storageprovider tree is used for watching the fs and not the dataprovider, because the dataprovider doesn't have a mount_id set which is needed to emit proper events. --- services/storage-users/pkg/revaconfig/drivers.go | 3 ++- services/storage-users/pkg/revaconfig/user.go | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/services/storage-users/pkg/revaconfig/drivers.go b/services/storage-users/pkg/revaconfig/drivers.go index 8d3c108e92..9f6675f046 100644 --- a/services/storage-users/pkg/revaconfig/drivers.go +++ b/services/storage-users/pkg/revaconfig/drivers.go @@ -85,7 +85,7 @@ func Local(cfg *config.Config) map[string]interface{} { } // Posix is the config mapping for the Posix storage driver -func Posix(cfg *config.Config) map[string]interface{} { +func Posix(cfg *config.Config, enableFSWatch bool) map[string]interface{} { return map[string]interface{}{ "root": cfg.Drivers.Posix.Root, "personalspacepath_template": cfg.Drivers.Posix.PersonalSpacePathTemplate, @@ -105,6 +105,7 @@ func Posix(cfg *config.Config) map[string]interface{} { "cache_auth_password": cfg.IDCache.AuthPassword, }, "use_space_groups": cfg.Drivers.Posix.UseSpaceGroups, + "watch_fs": enableFSWatch, "watch_type": cfg.Drivers.Posix.WatchType, "watch_path": cfg.Drivers.Posix.WatchPath, "watch_folder_kafka_brokers": cfg.Drivers.Posix.WatchFolderKafkaBrokers, diff --git a/services/storage-users/pkg/revaconfig/user.go b/services/storage-users/pkg/revaconfig/user.go index 29a26af32b..a40ba3d64e 100644 --- a/services/storage-users/pkg/revaconfig/user.go +++ b/services/storage-users/pkg/revaconfig/user.go @@ -14,7 +14,7 @@ func StorageProviderDrivers(cfg *config.Config) map[string]interface{} { "ocis": OcisNoEvents(cfg), "s3": S3(cfg), "s3ng": S3NGNoEvents(cfg), - "posix": Posix(cfg), + "posix": Posix(cfg, true), } } @@ -30,6 +30,6 @@ func DataProviderDrivers(cfg *config.Config) map[string]interface{} { "ocis": Ocis(cfg), "s3": S3(cfg), "s3ng": S3NG(cfg), - "posix": Posix(cfg), + "posix": Posix(cfg, false), } }