You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 12, 2018. It is now read-only.
First off, I've seen another issue that talks about not deleting image layers. Because of this, I figured I'd write my own image layer cleanup algorithm. The algorithm is simple: Walk the repositories using _index_images and mark image ids to keep. Once you're done scanning the repositories, delete all image layers that weren't marked to be kept.
I found out there's a problem with this, however: It seems that when you delete a tag in a repository, the repository's _index_images file does not get updated to remove any image layers that were only used by that tag.
It seems that since _index_images is sort of the single source for seeing what image layers a repository uses, that it should be updated accordingly whenever a tag is deleted.
I realize that doing this would increase the time it takes to do a tag delete, but as it stands currently, _index_images cannot be trusted to be the definitive list of image layers used in the repository.
First off, I've seen another issue that talks about not deleting image layers. Because of this, I figured I'd write my own image layer cleanup algorithm. The algorithm is simple: Walk the repositories using _index_images and mark image ids to keep. Once you're done scanning the repositories, delete all image layers that weren't marked to be kept.
I found out there's a problem with this, however: It seems that when you delete a tag in a repository, the repository's _index_images file does not get updated to remove any image layers that were only used by that tag.
It seems that since _index_images is sort of the single source for seeing what image layers a repository uses, that it should be updated accordingly whenever a tag is deleted.
I realize that doing this would increase the time it takes to do a tag delete, but as it stands currently, _index_images cannot be trusted to be the definitive list of image layers used in the repository.