我试图从ECR存储库中删除旧图像。我将通过删除图像的删除,而图像的拉长不超过X天。
此API给出 lastrecordedPullTime
。但是,大多数图像中都缺少此属性(我有数十万张图像,其中一些年龄超过5岁)。
我猜如果从未拉动图像,则缺少此属性,但是这些图像的数量很小。
我的理论是,该属性在一段时间之后被删除,在此期间未拉动图像。如果是这样,金额是多少?
还是还有另一个原因是 lastrecordedPullTime
属性缺失?
I am trying to delete old images from my ECR repositories. I was going to do it by deleting images, that have not been pulled longer than X days.
This API gives https://docs.aws.amazon.com/AmazonECR/latest/APIReference/API_ImageDetail.html the lastRecordedPullTime
. However this property is missing on majority of images (I have hundreds of thousands of images some of them older than 5 years).
I guess this property is missing if image was never pulled, but number of these images is marginal.
My theory would be, that this property is deleted after the some amount of time, during which image was not pulled. If so what is the amount?
Or is there another reason why is lastRecordedPullTime
property missing?
发布评论
评论(1)
对漫长的回应表示歉意。为了后代,我想回答。
该属性于2022年添加到ECR中,仅在拉出现有的旧图像中才会添加到现有的旧图像中。如果您没有此属性的旧图像,则应将其添加。
Apologies for the long delay in response. For posterity, I'd like to answer.
This attribute was added to ECR in 2022, and is only added to existing older images if they are pulled. If you have an older image without this attribute, pulling it should add it.