-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(cli): unhandled nextToken returned by listImagesCommand in garbage collector for ECR #32679
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.
A comment requesting an exemption should contain the text Exemption Request
. Additionally, if clarification is needed add Clarification Request
to a comment.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #32679 +/- ##
=======================================
Coverage 80.69% 80.69%
=======================================
Files 108 108
Lines 7019 7019
Branches 1299 1299
=======================================
Hits 5664 5664
Misses 1175 1175
Partials 180 180
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Exemption Request: I'm waiting for the CLI integration test to run. |
➡️ PR build request submitted to A maintainer must now check the pipeline and add the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Crap. Thank you for the repro steps and the fix. Super helpful. I am running this through the test pipeline and then will approve.
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
Comments on closed issues and PRs are hard for our team to see. |
Issue # (if applicable)
Closes #32498
Reason for this change
When
listImagesCommand
returns nextToken in thereadRepoInBatches
function, nextToken is not passed as an argument for the subsequentlistImagesCommand
execution, causinglistImagesCommand
to continue executing.https://github.com/aws/aws-cdk/blob/v2.173.4/packages/aws-cdk/lib/api/garbage-collection/garbage-collector.ts#L621
According to the
listImagesCommand
documentation, if maxResults is not specified, a maximum of 100 images will be returned, so this bug requires at least 100 images in the asset repository.https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ecr/Interface/ListImagesCommandInput/
Reproduction Steps
The following bash script and Dockerfile saved locally and executed, will push 120 container images to the asset repository.
You can reproduce this bug by running the following command after the images have been pushed.
Description of changes
Fix the problem of correctly handling nextToken when executing
listImagesCommand
in thereadRepoInBatches
function.Describe any new or updated permissions being added
Nothing.
Description of how you validated changes
Verifying that this bug has been fixed using the CLI integration tests is difficult, so only unit tests are added.
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license