From 56c3a522b7aedce12179101515e1e55a2e1e1c50 Mon Sep 17 00:00:00 2001 From: Daniel Mil Date: Thu, 31 Aug 2023 12:18:46 -0700 Subject: [PATCH 1/2] fix: Temporarily pin emulation image pulls on Windows --- samcli/local/docker/lambda_image.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/samcli/local/docker/lambda_image.py b/samcli/local/docker/lambda_image.py index 0ffb70434b..94feacdc47 100644 --- a/samcli/local/docker/lambda_image.py +++ b/samcli/local/docker/lambda_image.py @@ -169,6 +169,10 @@ def build(self, runtime, packagetype, image, layers, architecture, stream=None, tag_prefix = f"{runtime_only_number}-" base_image = f"{self._INVOKE_REPO_PREFIX}/{runtime_image_tag}" + # Temporarily add a version tag to the emulation image so that we don't pull a broken image + if platform.system().lower() == "windows" and runtime in [Runtime.go1x, Runtime.java8]: + base_image = f"{base_image}.2023.08.02.10" + if not base_image: raise InvalidIntermediateImageError(f"Invalid PackageType, PackageType needs to be one of [{ZIP}, {IMAGE}]") From 2380567812dc5b9cf65e0897ab84c3081034b1d2 Mon Sep 17 00:00:00 2001 From: Daniel Mil Date: Thu, 31 Aug 2023 15:06:24 -0700 Subject: [PATCH 2/2] Use enum value --- samcli/local/docker/lambda_image.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/samcli/local/docker/lambda_image.py b/samcli/local/docker/lambda_image.py index 94feacdc47..a8272b3c2c 100644 --- a/samcli/local/docker/lambda_image.py +++ b/samcli/local/docker/lambda_image.py @@ -170,7 +170,8 @@ def build(self, runtime, packagetype, image, layers, architecture, stream=None, base_image = f"{self._INVOKE_REPO_PREFIX}/{runtime_image_tag}" # Temporarily add a version tag to the emulation image so that we don't pull a broken image - if platform.system().lower() == "windows" and runtime in [Runtime.go1x, Runtime.java8]: + if platform.system().lower() == "windows" and runtime in [Runtime.go1x.value, Runtime.java8.value]: + LOG.info("Falling back to a previous version of the emulation image") base_image = f"{base_image}.2023.08.02.10" if not base_image: