-
-
Notifications
You must be signed in to change notification settings - Fork 225
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
incus-simplestreams: Add prune command #1381
base: main
Are you sure you want to change the base?
Conversation
cmd.Use = "prune" | ||
cmd.Short = "Clean up obsolete files and data" | ||
cmd.Long = cli.FormatSection("Description", | ||
`Cleans up obsolote tarball files and removes outdated versions of a product |
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.
Typo, should be obsolete
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.
Fixed.
The prune command identifies and deletes older versions of product data, | ||
retaining only the most recent existing version.`) |
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.
That last paragraph and the fact that the prune
command has prune-versions
flag is pretty confusing.
I think I'd rephrase that last paragraph as:
Additionally this command will delete older images, keeping a configurable number of older images per product.
Then instead of prune-version
we should probably just have a --retention
flag which defaults to 2
as in we'll keep two older versions of the product by default (same as we do on the public image server).
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.
So running incus-simplestreams prune
should:
- Find any orphaned files (no record in the index) and delete them
- Find any broken image and delete them from the index
- Find any product that has more than 1+flagRetention images and delete the older ones
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.
What do you mean by broken image
?
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.
That would be an image that's in the index but for which some of the files are missing on disk.
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.
Done.
Signed-off-by: Piotr Resztak <piotr.resztak@futurfusion.io>
a27236f
to
811e479
Compare
This PR adds a prune command to incus-simplestreams which:
Closes #1303