-
Notifications
You must be signed in to change notification settings - Fork 160
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(BA-997): Add image purge
CLI command for hard deleting ImageRow
#3951
base: main
Are you sure you want to change the base?
Conversation
forget
CLI commandforget
CLI command
forget
CLI commandforget
CLI command
forget
CLI commandforget
CLI command
forget
CLI commandimage purge
CLI command for hard deleting ImageRow
d1fdd5c
to
8c373c2
Compare
src/ai/backend/client/cli/image.py
Outdated
if remove_from_registry: | ||
result = session.Image.untag_image_from_registry(image_id) | ||
if not result["ok"]: | ||
print_fail("Image untag has failed: {0}".format(result["msg"])) | ||
sys.exit(ExitCode.FAILURE) | ||
session.Image.purge_image_by_id(image_id) |
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.
I guess it should be managed as a transaction, but is it okay if only one of the actions (remove_from_registry, purge_image_by_id) executes and the other fails?
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.
If untag_image_from_registry
succeeds but purge_image_by_id
fails, an inappropriate ImageRow will remain in the images
table.
Unless the purge_image
mutation is explicitly called for the corresponding ImageRow
, it will continue to exist.
Ideally, a soft deletion process should be added during the image rescan to handle images that have already been removed from the registry.
See BA-969 for this
717e305
to
4ed0f77
Compare
Resolves #3979 (BA-997).
Checklist: (if applicable)
📚 Documentation preview 📚: https://sorna--3951.org.readthedocs.build/en/3951/
📚 Documentation preview 📚: https://sorna-ko--3951.org.readthedocs.build/ko/3951/