pulp / pulp_container

Pulp Container Registry
https://docs.pulpproject.org/pulp_container/
GNU General Public License v2.0
23 stars 44 forks source link

Implement automatic cleanup when pull-through caching fails or its main distribution is removed #1683

Open lubosmj opened 2 months ago

lubosmj commented 2 months ago

At the moment, when the pulling fails in the middle of the execution, we may end up having some left-overs in the database. Similarly, when a user decides to remove a pull-through caching distribution, we should give her a way to remove everything, including created sub-distributions, remotes, and repositories.

lubosmj commented 2 months ago

Once this block succeeds: https://github.com/pulp/pulp_container/blob/a832b9fc9a06cf96fda20fc7203f06a2baa6b9c4/pulp_container/app/registry_api.py#L313-L334 we can end up having an orphaned repository-remote-distribution triplet if the actual remote repository is not reachable. Perhaps, we should first try to ping the remote repository to verify whether it is available or not.