From bc53e8b7ee615ef77da50d1434102396281cfcdd Mon Sep 17 00:00:00 2001 From: Jakob Keller <57402305+jakob-keller@users.noreply.github.com> Date: Sun, 16 Feb 2025 21:39:53 +0100 Subject: [PATCH] Lambda: Determine Lambda image deterministically --- moto/awslambda/models.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/moto/awslambda/models.py b/moto/awslambda/models.py index de8fc1f13e9d..b51676126112 100644 --- a/moto/awslambda/models.py +++ b/moto/awslambda/models.py @@ -1023,13 +1023,11 @@ def _invoke_lambda(self, event: Optional[str] = None) -> Tuple[str, bool, str]: # - lambci/lambda (the repo with older/outdated AWSLambda images # # We'll cycle through all of them - when we find the repo that contains our image, we use it - image_repos = set( - [ - settings.moto_lambda_image(), - "mlupin/docker-lambda", - "lambci/lambda", - ] - ) + image_repos = { # dict maintains insertion order + settings.moto_lambda_image(): None, + "mlupin/docker-lambda": None, + "lambci/lambda": None, + } for image_repo in image_repos: image_ref = ( image_repo