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

Handle docker container creation error #6922

Merged
merged 1 commit into from
Apr 10, 2024
Merged

Conversation

hawflau
Copy link
Contributor

@hawflau hawflau commented Apr 9, 2024

Which issue(s) does this change fix?

#6510

Why is this change necessary?

To catch and handle docker container creation errors when running sam local invoke, sam local start-api and sam local start-lambda

How does it address the issue?

Catch the error and propagate it to CLI

What side effects does this change have?

Mandatory Checklist

PRs will only be reviewed after checklist is complete

  • Add input/output type hints to new functions/methods
  • Write design document if needed (Do I need to write a design document?)
  • Write/update unit tests
  • Write/update integration tests
  • Write/update functional tests if needed
  • make pr passes
  • make update-reproducible-reqs if dependencies were changed
  • Write documentation

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@hawflau hawflau marked this pull request as ready for review April 9, 2024 04:37
@hawflau hawflau requested a review from a team as a code owner April 9, 2024 04:37
Copy link
Contributor

@mndeveci mndeveci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes LGTM! Can we add any integration tests that we can validate the changes?

Copy link
Contributor

@jysheng123 jysheng123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the code looks fine, but im not too sure if this would fix the customer's issue specifically. I think the customer is asking for validation before trying to create the container that will say the memory size is invalid, the code changes here looks like it will just do validation during the invoke, but it should be validating during the SAM CLI build step.

@hawflau
Copy link
Contributor Author

hawflau commented Apr 10, 2024

To summarize before merging

The change in this PR is to catch and handle Docker Container Creation Error and show a message about the error and telling customer to check the template. SAM CLI provides the sam validate --lint command to catch template issues.

The expectation on the issue #6510 was "Validation errors would be shown when the SAM config is loaded, before the values are used for building and builds would not succeed when invalid values are used", which was captured in #3244 as a feature request.

@hawflau hawflau added this pull request to the merge queue Apr 10, 2024
Merged via the queue into aws:develop with commit da2ce02 Apr 10, 2024
57 checks passed
@hawflau hawflau deleted the refix-6510 branch April 10, 2024 21:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants