ArmyCyberInstitute / cmgr

CTF Challenge Manager
Apache License 2.0
17 stars 9 forks source link

Avoid erroring on not found case during removal #29

Closed dmartin closed 2 years ago

dmartin commented 2 years ago

If resources managed outside of cmgr's direct control become out-of-sync with the database, it can become difficult to get back to a good state without manually editing or recreating the DB.

For example, if an instance's container or network were to unintentionally get deleted, subsequent destroy, remove-schema, or update-schema calls could fail, although simply proceeding and removing the bad instance's metadata would be sufficient to get things back into a good state.

This PR makes the behavior of removing objects (containers, networks, images, artifact tarballs) more forgiving by simply logging a warning and proceeding if the specified object cannot be found.