diff --git a/pyproject.toml b/pyproject.toml index a5265c1..aa5ab5b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "scw-serverless" -version = "1.0.0" +version = "1.0.1" description = "Framework for writing serverless APIs in Python, using Scaleway functions and containers." authors = ["Scaleway Serverless Team "] readme = "README.md" @@ -14,7 +14,7 @@ keywords = ["serverless", "scaleway", "functions", "cloud", "faas"] # "Development Status :: 4 - Beta" # "Development Status :: 5 - Production/Stable" classifiers = [ - "Development Status :: 3 - Alpha", + "Development Status :: 4 - Beta", "Intended Audience :: Developers", "Intended Audience :: Information Technology", "Topic :: Software Development :: Libraries :: Application Frameworks", diff --git a/scw_serverless/gateway/gateway_manager.py b/scw_serverless/gateway/gateway_manager.py index ced4d1f..94bd83e 100644 --- a/scw_serverless/gateway/gateway_manager.py +++ b/scw_serverless/gateway/gateway_manager.py @@ -50,13 +50,6 @@ def update_routes(self) -> None: if function.gateway_route ] - # The Gateway deletes routes based on the relative_url, - # so we need to cleanup all routes at the start, - # otherwise we might accidentally delete a route we previously created. - # If it has the same relative_url but different http methods. - for function in routed_functions: - self.gateway_client.delete_route(function.gateway_route) # type: ignore - for function in routed_functions: if function.name not in created_functions: raise RuntimeError( @@ -68,6 +61,4 @@ def update_routes(self) -> None: function.gateway_route.target = target # type: ignore for function in routed_functions: - if not function.gateway_route: - continue - self.gateway_client.create_route(function.gateway_route) + self.gateway_client.create_route(function.gateway_route) # type: ignore diff --git a/tests/integrations/project_fixture.py b/tests/integrations/project_fixture.py index 68b7091..ac263e6 100644 --- a/tests/integrations/project_fixture.py +++ b/tests/integrations/project_fixture.py @@ -9,6 +9,7 @@ from scaleway.function.v1beta1 import FunctionV1Beta1API from scaleway.registry.v1 import RegistryV1API from scaleway_core.api import ScalewayException +from scaleway_core.utils import WaitForOptions from .utils import create_client @@ -62,7 +63,9 @@ def _cleanup_project(client: Client, project_id: ProjectID): raise e for registry in registries: try: - registry_api.wait_for_namespace(namespace_id=registry.id) + registry_api.wait_for_namespace( + namespace_id=registry.id, options=WaitForOptions(timeout=600) + ) except ScalewayException as e: if e.status_code != 404: raise e diff --git a/tests/test_gateway/test_gateway_manager.py b/tests/test_gateway/test_gateway_manager.py index 1334372..52023e1 100644 --- a/tests/test_gateway/test_gateway_manager.py +++ b/tests/test_gateway/test_gateway_manager.py @@ -87,14 +87,6 @@ def test_gateway_manager_update_routes( json={"functions": []}, ) - # We should attempt to delete the route - mocked_responses.delete( - MOCK_GATEWAY_URL + "/scw", # type: ignore - match=[ - header_matcher({"X-Auth-Token": MOCK_GATEWAY_API_KEY}), - json_params_matcher(params=function.gateway_route.asdict()), # type: ignore - ], - ) # We should attempt to create the route mocked_responses.post( MOCK_GATEWAY_URL + "/scw", # type: ignore