Skip to content

Commit

Permalink
ECR: image digest fix (getmoto#6999)
Browse files Browse the repository at this point in the history
  • Loading branch information
rafcio19 authored Nov 7, 2023
1 parent 6e99608 commit 060b109
Show file tree
Hide file tree
Showing 3 changed files with 282 additions and 291 deletions.
2 changes: 2 additions & 0 deletions moto/ecr/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,7 @@ def put_image(
image_manifest: str,
image_tag: str,
image_manifest_mediatype: Optional[str] = None,
digest: Optional[str] = None,
) -> Image:
if repository_name in self.repositories:
repository = self.repositories[repository_name]
Expand Down Expand Up @@ -612,6 +613,7 @@ def put_image(
image_manifest,
repository_name,
image_manifest_mediatype,
digest,
)
repository.images.append(image)
if existing_images_with_matching_tag:
Expand Down
3 changes: 2 additions & 1 deletion moto/ecr/responses.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,9 @@ def put_image(self) -> str:
image_manifest = self._get_param("imageManifest")
image_tag = self._get_param("imageTag")
image_manifest_media_type = self._get_param("imageManifestMediaType")
digest = self._get_param("imageDigest")
image = self.ecr_backend.put_image(
repository_str, image_manifest, image_tag, image_manifest_media_type
repository_str, image_manifest, image_tag, image_manifest_media_type, digest
)

return json.dumps({"image": image.response_object})
Expand Down
Loading

0 comments on commit 060b109

Please sign in to comment.