Skip to content

feat: add image docker cleanup workflows#19

Merged
gabor-boros merged 1 commit intomainfrom
gabor/image-cleanup-jobs
Mar 28, 2026
Merged

feat: add image docker cleanup workflows#19
gabor-boros merged 1 commit intomainfrom
gabor/image-cleanup-jobs

Conversation

@gabor-boros
Copy link
Copy Markdown
Collaborator

[SE-6574]

Add cleanup job to cluster template and template repository to get rid of old docker images.

SE-6574

Signed-off-by: Gabor Boros <gabor@opencraft.com>
@gabor-boros gabor-boros force-pushed the gabor/image-cleanup-jobs branch from e97269a to 36cfe51 Compare March 27, 2026 11:03
Comment on lines +281 to +291
keep_tags = {item.tag for item in sorted_entries[:max_per_instance]}
else:
assert retention_days is not None
cutoff = today_utc - timedelta(days=retention_days)

for item in sorted_entries:
if item.build_date >= cutoff:
keep_tags.add(item.tag)

for item in filter(lambda item: item.tag not in keep_tags, sorted_entries):
delete_tags.add(item.tag)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to get keep_tags first than then figure out the delete tags from it? Could we not figure out delete tags directly?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could, but to me, this implementation looked clearer in intent as we add to delete tags at one place. If this is just a nit from your side, I would go ahead and fix later if it is necessary.

@kaustavb12
Copy link
Copy Markdown
Member

LGTM 👍

@gabor-boros I have read through the code and overall it looks good to me. I haven't been able to test this though.

@gabor-boros gabor-boros merged commit 55c8169 into main Mar 28, 2026
1 check passed
gabor-boros added a commit that referenced this pull request Mar 30, 2026
SE-6574

Signed-off-by: Gabor Boros <gabor@opencraft.com>
gabor-boros added a commit that referenced this pull request Mar 30, 2026
SE-6574

Signed-off-by: Gabor Boros <gabor@opencraft.com>
gabor-boros added a commit that referenced this pull request Mar 30, 2026
SE-6574

Signed-off-by: Gabor Boros <gabor@opencraft.com>
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