-
Notifications
You must be signed in to change notification settings - Fork 618
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
image manager: cleanup 'dead' and 'created' containers #2015
Conversation
agent/engine/docker_image_manager.go
Outdated
seelog.Errorf("Error inspecting non-ECS image name: %s - %v", imageName, iiErr) | ||
// Get the all image sizes | ||
for _, image := range nonECSImagesRmEligible { | ||
resp, err := imageManager.client.InspectImage(image.ImageID) |
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.
any reason why this was change from imageName to imageID?
Sometimes, two images can have same ID but different names. just making sure this doesn't break anything.
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 reason I changed this to image ID is because with image name we don't properly cleanup 'dangling' images (because the name is <none>
). I made a comment about this here: #1684 (comment)
But that is a good catch, I did not realize two images can have the same ID but a different name. Maybe changing this behavior should be broken out into a separate issue and PR, if we want to do it at all.
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.
okay, I've removed the parts that removed 'dangling images'
788ab3a
to
8372fef
Compare
also cleanup of 'dangling' images that have no tags or names associated with them (ie, they show as <none> in 'docker images') closes aws#1684 unit tests dont touch dangling images -- for now skip containers that don't have a finished time
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 tests could be made table-driven in a future refactor.
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.
looks good. nice to see these thorough tests.
also cleanup of 'dangling' images that have no tags or names associated
with them (ie, they show as in 'docker images')
see #1684
Summary
Implementation details
Testing
New tests cover the changes:
Description for the changelog
Licensing
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.