Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lambda: Pick Lambda image deterministically #8603

Merged
merged 1 commit into from
Feb 17, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions moto/awslambda/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@
layer_tar = zip2tar(layer_zip)
container.put_archive("/opt", layer_tar)
except zipfile.BadZipfile as e:
warnings.warn(f"Error extracting layer to Lambda: {e}")

Check warning on line 246 in moto/awslambda/models.py

View workflow job for this annotation

GitHub Actions / test / test (3.13)

Error extracting layer to Lambda: File is not a zip file

Check warning on line 246 in moto/awslambda/models.py

View workflow job for this annotation

GitHub Actions / test / test (3.11)

Error extracting layer to Lambda: File is not a zip file

Check warning on line 246 in moto/awslambda/models.py

View workflow job for this annotation

GitHub Actions / test / test (3.12)

Error extracting layer to Lambda: File is not a zip file

Check warning on line 246 in moto/awslambda/models.py

View workflow job for this annotation

GitHub Actions / test / test (3.9)

Error extracting layer to Lambda: File is not a zip file

Check warning on line 246 in moto/awslambda/models.py

View workflow job for this annotation

GitHub Actions / test / test (3.8)

Error extracting layer to Lambda: File is not a zip file

Check warning on line 246 in moto/awslambda/models.py

View workflow job for this annotation

GitHub Actions / test / test (3.10)

Error extracting layer to Lambda: File is not a zip file
finally:
container.remove(force=True)

Expand Down Expand Up @@ -1023,13 +1023,11 @@
# - 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
Expand Down
Loading