As is, apply_many and delete_many will immediately fail on the first lightkube error. We should enable them to (either by default or optionally) complete all the operations they are able to before raising an exception.
For example, if you use delete_many on a list of resources where the first in the list does not exist, delete_many will attempt to delete the first, see a ApiError(404), and fail immediately without trying to delete the other resources. This is particularly troubling for charm remove hooks where we want to attempt to delete everything, but are ok if some things are already gone.
As is,
apply_many
anddelete_many
will immediately fail on the first lightkube error. We should enable them to (either by default or optionally) complete all the operations they are able to before raising an exception.For example, if you use
delete_many
on a list of resources where the first in the list does not exist,delete_many
will attempt to delete the first, see aApiError(404)
, and fail immediately without trying to delete the other resources. This is particularly troubling for charm remove hooks where we want to attempt to delete everything, but are ok if some things are already gone.