(aws-cdk/lib/api/garbage-collection): (Garbage collection for ECR prints incorrect number of assets/images deleted and runs indefinitely) #32498
Labels
@aws-cdk/aws-ecr
Related to Amazon Elastic Container Registry
@aws-cdk/core
Related to core CDK functionality
bug
This issue is a bug.
investigating
This issue is being investigated and/or work is in progress to resolve the issue.
p2
Describe the bug
When running cdk gc for ECR, the number of assets is misprinted and the files scanned exceeds the number in the bootstrap repository. This results in the percentage of files scanned exceeding 100.00% and therefore command runs indefinitely. Additionally, images are not being tagged in any attempted run, it is jumping straight to deleting the a random number of unused images which is not reflected in the print statement.
Regression Issue
Last Known Working CDK Version
No response
Expected Behavior
The printed output should have stated:
[100.00%] 136 files scanned: 3 assets (0.56 GiB) tagged, 0 assets (0.00 GiB) deleted.
Current Behavior
[735.29%] 1000 files scanned: 0 assets (0.00 GiB) tagged, 30 assets (5.63 GiB) deleted.
The printed output was incorrect and rather than tagging it began deleting straight away.
Reproduction Steps
cdk gc aws://
<my-account-id>
/<my-only-used-region>
--type ecr --unstable=gc --created-buffer-days 0 --action full --confirm=truePossible Solution
No response
Additional Information/Context
When running this for an account which has an ECR repo with ~8000 images the progression printing is again displayed incorrectly. As the progression cycled and increased with the loop, the number progression progression prints for each progression iteration double and the number of images deleted cumulatively decreases until it deletes no images for each iteration.
CDK CLI Version
2.172.0
Framework Version
No response
Node.js Version
v20.11.1
OS
Ubuntu 22.04.4 LTS
Language
Python
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: