diff --git a/libs/compute_api/src/spec.rs b/libs/compute_api/src/spec.rs index 5e67ccce00..ad246c48ec 100644 --- a/libs/compute_api/src/spec.rs +++ b/libs/compute_api/src/spec.rs @@ -242,13 +242,22 @@ impl RemoteExtSpec { match self.extension_data.get(real_ext_name) { Some(_ext_data) => { + // We have decided to use the Go naming convention due to Kubernetes. + + let arch = match std::env::consts::ARCH { + "x86_64" => "amd64", + "aarch64" => "arm64", + arch => arch, + }; + // Construct the path to the extension archive // BUILD_TAG/PG_MAJOR_VERSION/extensions/EXTENSION_NAME.tar.zst // // Keep it in sync with path generation in // https://github.com/neondatabase/build-custom-extensions/tree/main - let archive_path_str = - format!("{build_tag}/{pg_major_version}/extensions/{real_ext_name}.tar.zst"); + let archive_path_str = format!( + "{build_tag}/{arch}/{pg_major_version}/extensions/{real_ext_name}.tar.zst" + ); Ok(( real_ext_name.to_string(), RemotePath::from_string(&archive_path_str)?, diff --git a/test_runner/regress/test_download_extensions.py b/test_runner/regress/test_download_extensions.py index 77babe12cd..a81d55e57b 100644 --- a/test_runner/regress/test_download_extensions.py +++ b/test_runner/regress/test_download_extensions.py @@ -1,6 +1,7 @@ from __future__ import annotations import os +import platform import shutil import tarfile from typing import TYPE_CHECKING @@ -58,7 +59,18 @@ def test_remote_extensions( extensions_endpoint = f"http://{host}:{port}/pg-ext-s3-gateway" build_tag = os.environ.get("BUILD_TAG", "latest") - archive_route = f"{build_tag}/v{pg_version}/extensions/test_extension.tar.zst" + + # We have decided to use the Go naming convention due to Kubernetes. + arch = platform.machine() + match arch: + case "aarch64": + arch = "arm64" + case "x86_64": + arch = "amd64" + case _: + pass + + archive_route = f"{build_tag}/{arch}/v{pg_version}/extensions/test_extension.tar.zst" tarball = test_output_dir / "test_extension.tar" extension_dir = ( base_dir / "test_runner" / "regress" / "data" / "test_remote_extensions" / "test_extension"