Skip to content
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

Sort by uploaded date when creation date is old #91

Merged
merged 1 commit into from
Jul 20, 2022

Conversation

sethvargo
Copy link
Member

Certain build tools like pack set the container creation time to the very distant past, like before Docker even existed. This breaks GCR Cleaner's sorting algorithm for "keep". This commit introduces fallback sorting for when the creation date before March 20, 2013 or when two creation dates are equal. In those situations, GCR Cleaner uses the Uploaded date for sorting. In all other cases, it uses the Creation timestamp.

Certain build tools like pack set the container creation time to the very distant past, like before Docker even existed. This breaks GCR Cleaner's sorting algorithm for "keep". This commit introduces fallback sorting for when the creation date before March 20, 2013 or when two creation dates are equal. In those situations, GCR Cleaner uses the Uploaded date for sorting. In all other cases, it uses the Creation timestamp.

- References: #89
- References: #88
@sethvargo sethvargo merged commit fb6b41c into main Jul 20, 2022
@sethvargo sethvargo deleted the sethvargo/docker_exist branch July 20, 2022 14:15
@aisbaa
Copy link

aisbaa commented Jul 26, 2022

Thank you for adding this! We at uber adopting bazel for building docker images in some areas. This will help us to keep our gcr clean and tidy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants