canonical / data-platform-libs

A collection of charm libraries curated by the Data Platform Team
https://charmhub.io/data-platform-libs
Apache License 2.0
9 stars 9 forks source link

[DPE-2828] Delete field from relation #105

Closed juditnovak closed 9 months ago

juditnovak commented 9 months ago

Adding delete_relation_data() function that allows to remove fields from the relation on request.

IT's NOT implemented as part of the update function, given the already existing complexity. I.e. as we're already "cherry-picking" among input fields ("Is this in a secret?" "Is this in the databag?") we shouldn't further load this logic to even select whether None values may be supplied to indicate removal for real.... Ah, and don't forget to remove the secret if all fields deleted -- otherwise you get an error if saving an empty secret... Pls, no more spagetti than what we already have :-)

Instead it seems to make more sense to have a clean interface for deletion. If one wants to delete a field, (s)he should do that explicitly. Cleaner interface, cleaner code...