From 65c9c3791da39aade7017c947b693b97462776f0 Mon Sep 17 00:00:00 2001 From: Elvis Pranskevichus Date: Wed, 25 Jan 2023 20:40:45 -0800 Subject: [PATCH] Adjust cloud instance hostname derivation (#412) --- edgedb/con_utils.py | 4 ++-- tests/shared-client-testcases | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/edgedb/con_utils.py b/edgedb/con_utils.py index 45b68b1d..eb79f6e0 100644 --- a/edgedb/con_utils.py +++ b/edgedb/con_utils.py @@ -888,8 +888,8 @@ def _parse_cloud_instance_name_into_config( except Exception: raise errors.ClientConnectionError("Invalid secret key") payload = f"{org_slug}/{instance_name}".encode("utf-8") - dns_bucket = binascii.crc_hqx(payload, 0) % 9900 - host = f"{instance_name}.{org_slug}.c-{dns_bucket:x}.i.{dns_zone}" + dns_bucket = binascii.crc_hqx(payload, 0) % 100 + host = f"{instance_name}--{org_slug}.c-{dns_bucket:02d}.i.{dns_zone}" resolved_config.set_host(host, source) diff --git a/tests/shared-client-testcases b/tests/shared-client-testcases index 5f2453c3..72675edf 160000 --- a/tests/shared-client-testcases +++ b/tests/shared-client-testcases @@ -1 +1 @@ -Subproject commit 5f2453c30521cfb027ac56e517289da359e90097 +Subproject commit 72675edfd43cd39bbe39b706e0847453676aac35