ECR: fix image wrong type for pushed_at #7122
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.