awslabs / ecr-cleanup-lambda

A script to discover stale ECR images and take action on them with Lambda to help reduce costs.
Other
161 stars 96 forks source link

Malformed AWS CLI batch-delete-image call parameter --image-ids #5

Closed SharpEdgeMarshall closed 7 years ago

SharpEdgeMarshall commented 7 years ago

When calling batch-delete-image deletesha object is passed as imageIds parameter but is malformed

Cloudwatch log:

ParamValidationError: Parameter validation failed:
Invalid type for parameter imageIds[0].imageDigest, value: {'imageDigest': u'sha256:MYSHA256'}, type: <type 'dict'>, valid types: <type 'basestring'>

Cause: The sha256 is inserted inside a {'imageDigest':value} 2 times and the resulting array is:

[{'imageDigest':{'imageDigest`:value}}, ...]

Solution: Remove the duplicated injection