canonical / charmed-kubeflow-chisme

Shared Utilities used across Charmed Kubeflow
Apache License 2.0
1 stars 4 forks source link

refactor `apply_many` and `delete_many` so they (optionally?) do not fail fast when hitting an error #53

Open ca-scribner opened 1 year ago

ca-scribner commented 1 year ago

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.

phoevos commented 1 year ago

The described functionality for delete_many has been added as part of the following PR: