From af9cd4ca64652fae262e6f7b5d201f6e0adc989b Mon Sep 17 00:00:00 2001 From: Simon Willison Date: Thu, 5 Mar 2020 17:44:15 -0600 Subject: [PATCH] Fixes for new --memory option, refs #694 --- datasette/publish/cloudrun.py | 2 +- docs/datasette-publish-cloudrun-help.txt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/datasette/publish/cloudrun.py b/datasette/publish/cloudrun.py index 91408287..8271209a 100644 --- a/datasette/publish/cloudrun.py +++ b/datasette/publish/cloudrun.py @@ -160,6 +160,6 @@ def get_existing_services(): def _validate_memory(ctx, param, value): - if re.match(r"^\d+(Gi|G|Mi|M)$", value) is None: + if value and re.match(r"^\d+(Gi|G|Mi|M)$", value) is None: raise click.BadParameter("--memory should be a number then Gi/G/Mi/M e.g 1Gi") return value diff --git a/docs/datasette-publish-cloudrun-help.txt b/docs/datasette-publish-cloudrun-help.txt index d1bc0a9a..f4ec6221 100644 --- a/docs/datasette-publish-cloudrun-help.txt +++ b/docs/datasette-publish-cloudrun-help.txt @@ -25,4 +25,5 @@ Options: --service TEXT Cloud Run service to deploy (or over-write) --spatialite Enable SpatialLite extension --show-files Output the generated Dockerfile and metadata.json + --memory TEXT Memory to allocate in Cloud Run, e.g. 1Gi --help Show this message and exit.