-
Notifications
You must be signed in to change notification settings - Fork 4
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
feat: added new workflow to prune old images #88
feat: added new workflow to prune old images #88
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.
LGTM
prune-untagged: true | ||
prune-tags-regexes: | | ||
^commit- | ||
SNAPSHOT-.*$ |
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.
After the first prune we can remove this regex because our new images don't follow this naming pattern anymore.
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 regex is unnecessary. We just want to remove old images, no matter what naming convention they used. Let's just remove it altogether.
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.
Then we'd also remove our stable release images because git tags != image tags
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.
Totally right, my bad 😅
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.
LGTM, don't forget to turn off the dryrun before merging.
Additionally after merging create a PR to resolve my conversation
Motivation
Relates to #80
Changes
Added a new workflow to prune old images of packages sparrow and charts/sparrow.
The workflow is configured to prune all images older than 7 days that start with 'commit-' or end in 'SNAPSHOT-...' for the sparrow package.
For the charts/sparrow package it will prune all images older than 7 days that end in 'commit-...'.
It runs daily at midnight (could be changed if wanted).
It is still configured to dry-run just to be sure. This should be changed once we're sure nothings going to break.
For additional information look at the commits.
Tests done
I've tested the workflow in dry-run in a fork I made and it worked accordingly.
No stable version or version under 7 days was marked for pruning.
https://github.com/JTaeuber/sparrow/actions/runs/7642146860
This is the Test of the Workflow without keeping the images younger than 7 days for the charts/sparrow package, so you can see what it would prune if they were older than 7 days.
TODO