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

ECR: fix image wrong type for pushed_at #7122

Merged
merged 1 commit into from Dec 14, 2023
Merged

ECR: fix image wrong type for pushed_at #7122

merged 1 commit into from Dec 14, 2023

Conversation

SoenkeD
Copy link
Contributor

@SoenkeD SoenkeD commented Dec 14, 2023

When executing ECR.DescribeImages() and there is an image to describe the Go AWS SDK fails to de-serialize the response with the following message de serialization failed, failed to decode response body, expected PushTimestamp to be a JSON Number, got string instead .
When looking into the code https://github.com/getmoto/moto/blob/master/moto/ecr/models.py line 279 (self.image_pushed_at = str(datetime.now(timezone.utc).isoformat()) ) which obviously is a string. When looking at the AWS API documentation at https://docs.aws.amazon.com/AmazonECR/latest/APIReference/API_DescribeImages.html#API_DescribeImages_ResponseSyntax AWS expects a number (likely a timestamp) so the bug seems to not be in the GO SDK, but in Moto.
Trying the patched version did indeed fix the problem.

Copy link

codecov bot commented Dec 14, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (e422e95) 95.88% compared to head (80ebe3f) 95.88%.
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #7122   +/-   ##
=======================================
  Coverage   95.88%   95.88%           
=======================================
  Files         834      834           
  Lines       82202    82202           
=======================================
  Hits        78819    78819           
  Misses       3383     3383           
Flag Coverage Δ
servertests 35.80% <0.00%> (ø)
unittests 95.82% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@bblommers bblommers left a comment

Choose a reason for hiding this comment

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

LGTM - thanks for the fix @SoenkeD!

@bblommers bblommers added this to the 4.2.12 milestone Dec 14, 2023
@bblommers bblommers merged commit 43d3f14 into getmoto:master Dec 14, 2023
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants