From f4e237c7babcd902024316390f3547ec51080d4a Mon Sep 17 00:00:00 2001 From: Ralf Grubenmann Date: Tue, 14 Jan 2025 15:27:02 +0100 Subject: [PATCH] fix: renable s3 customizations for data connectors --- components/renku_data_services/storage/rclone.py | 9 ++++++--- test/bases/renku_data_services/data_api/test_storage.py | 1 + 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/components/renku_data_services/storage/rclone.py b/components/renku_data_services/storage/rclone.py index 069b020b7..3d2c4aa02 100644 --- a/components/renku_data_services/storage/rclone.py +++ b/components/renku_data_services/storage/rclone.py @@ -159,11 +159,14 @@ def __patch_schema_remove_oauth_propeties(spec: list[dict[str, Any]]) -> None: @staticmethod def __find_storage(spec: list[dict[str, Any]], prefix: str) -> dict[str, Any]: - """Find and return the WebDAV storage schema from the spec.""" + """Find and return the storage schema from the spec. + + This returns the original entry for in-place modification. + """ storage = next((s for s in spec if s["Prefix"] == prefix), None) if not storage: raise errors.ValidationError(message=f"'{prefix}' storage not found in schema.") - return deepcopy(storage) + return storage @staticmethod def __add_webdav_based_storage( @@ -176,7 +179,7 @@ def __add_webdav_based_storage( ) -> None: """Create a modified copy of WebDAV storage and add it to the schema.""" # Find WebDAV storage schema and create a modified copy - storage_copy = RCloneValidator.__find_storage(spec, "webdav") + storage_copy = deepcopy(RCloneValidator.__find_storage(spec, "webdav")) storage_copy.update({"Prefix": prefix, "Name": name, "Description": description}) custom_options = [ diff --git a/test/bases/renku_data_services/data_api/test_storage.py b/test/bases/renku_data_services/data_api/test_storage.py index 219284a76..2e9398acd 100644 --- a/test/bases/renku_data_services/data_api/test_storage.py +++ b/test/bases/renku_data_services/data_api/test_storage.py @@ -600,3 +600,4 @@ async def test_storage_schema(storage_test_client) -> None: providers = next(p for p in s3["options"] if p["name"] == "provider") assert providers assert providers.get("examples") + assert any(e["value"] == "Switch" for e in providers.get("examples"))