From 5aa9e618f162bd502532bd5297ca0d6fa73e62e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Duffeck?= Date: Mon, 17 Jul 2023 10:09:54 +0200 Subject: [PATCH] Make the storage-users propagator configurable --- services/storage-users/pkg/config/config.go | 2 ++ services/storage-users/pkg/revaconfig/drivers.go | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/services/storage-users/pkg/config/config.go b/services/storage-users/pkg/config/config.go index 7c738792bf..ac0ede863a 100644 --- a/services/storage-users/pkg/config/config.go +++ b/services/storage-users/pkg/config/config.go @@ -94,6 +94,7 @@ type Drivers struct { // OCISDriver is the storage driver configuration when using 'ocis' storage driver type OCISDriver struct { MetadataBackend string `yaml:"metadata_backend" env:"OCIS_DECOMPOSEDFS_METADATA_BACKEND;STORAGE_USERS_OCIS_METADATA_BACKEND" desc:"The backend to use for storing metadata. Supported values are 'messagepack' and 'xattrs'. The setting 'messagepack' uses a dedicated file to store file metadata while 'xattrs' uses extended attributes to store file metadata. Defaults to 'messagepack'."` + Propagator string `yaml:"propagator" env:"OCIS_DECOMPOSEDFS_PROPAGATOR;STORAGE_USERS_OCIS_PROPAGATOR" desc:"The propagator to use. Only 'sync' is fully supported at that point, 'async' is available as an experimental option."` // Root is the absolute path to the location of the data Root string `yaml:"root" env:"STORAGE_USERS_OCIS_ROOT" desc:"The directory where the filesystem storage will store blobs and metadata. If not defined, the root directory derives from $OCIS_BASE_DATA_PATH:/storage/users."` UserLayout string `yaml:"user_layout" env:"STORAGE_USERS_OCIS_USER_LAYOUT" desc:"Template string for the user storage layout in the user directory."` @@ -116,6 +117,7 @@ type OCISDriver struct { // S3NGDriver is the storage driver configuration when using 's3ng' storage driver type S3NGDriver struct { MetadataBackend string `yaml:"metadata_backend" env:"STORAGE_USERS_S3NG_METADATA_BACKEND" desc:"The backend to use for storing metadata. Supported values are 'xattrs' and 'messagepack'. The setting 'xattrs' uses extended attributes to store file metadata while 'messagepack' uses a dedicated file to store file metadata. Defaults to 'xattrs'."` + Propagator string `yaml:"propagator" env:"OCIS_DECOMPOSEDFS_PROPAGATOR;STORAGE_USERS_S3NG_PROPAGATOR" desc:"The propagator to use. Only 'sync' is fully supported at that point, 'async' is available as an experimental option."` // Root is the absolute path to the location of the data Root string `yaml:"root" env:"STORAGE_USERS_S3NG_ROOT" desc:"The directory where the filesystem storage will store metadata for blobs. If not defined, the root directory derives from $OCIS_BASE_DATA_PATH:/storage/users."` UserLayout string `yaml:"user_layout" env:"STORAGE_USERS_S3NG_USER_LAYOUT" desc:"Template string for the user storage layout in the user directory."` diff --git a/services/storage-users/pkg/revaconfig/drivers.go b/services/storage-users/pkg/revaconfig/drivers.go index 7fb1047578..55620e979c 100644 --- a/services/storage-users/pkg/revaconfig/drivers.go +++ b/services/storage-users/pkg/revaconfig/drivers.go @@ -116,6 +116,7 @@ func OwnCloudSQL(cfg *config.Config) map[string]interface{} { func Ocis(cfg *config.Config) map[string]interface{} { return map[string]interface{}{ "metadata_backend": cfg.Drivers.OCIS.MetadataBackend, + "propagator": cfg.Drivers.OCIS.Propagator, "root": cfg.Drivers.OCIS.Root, "user_layout": cfg.Drivers.OCIS.UserLayout, "share_folder": cfg.Drivers.OCIS.ShareFolder, @@ -171,6 +172,7 @@ func Ocis(cfg *config.Config) map[string]interface{} { func OcisNoEvents(cfg *config.Config) map[string]interface{} { return map[string]interface{}{ "metadata_backend": cfg.Drivers.OCIS.MetadataBackend, + "propagator": cfg.Drivers.OCIS.Propagator, "root": cfg.Drivers.OCIS.Root, "user_layout": cfg.Drivers.OCIS.UserLayout, "share_folder": cfg.Drivers.OCIS.ShareFolder, @@ -225,6 +227,7 @@ func S3(cfg *config.Config) map[string]interface{} { func S3NG(cfg *config.Config) map[string]interface{} { return map[string]interface{}{ "metadata_backend": cfg.Drivers.S3NG.MetadataBackend, + "propagator": cfg.Drivers.S3NG.Propagator, "root": cfg.Drivers.S3NG.Root, "user_layout": cfg.Drivers.S3NG.UserLayout, "share_folder": cfg.Drivers.S3NG.ShareFolder, @@ -284,6 +287,7 @@ func S3NG(cfg *config.Config) map[string]interface{} { func S3NGNoEvents(cfg *config.Config) map[string]interface{} { return map[string]interface{}{ "metadata_backend": cfg.Drivers.S3NG.MetadataBackend, + "propagator": cfg.Drivers.S3NG.Propagator, "root": cfg.Drivers.S3NG.Root, "user_layout": cfg.Drivers.S3NG.UserLayout, "share_folder": cfg.Drivers.S3NG.ShareFolder,