Closed vdo closed 5 years ago
After completing an implementation at https://github.com/dappnode/DNP_ADMIN/pull/283, I think this issue is not that simple to resolve.
Since the only deletable volumes are named volumes, if they are shared there must be a single declaration in some DNP's docker-compose. The DNP that declares the volume can be considered the "owner" of the volume, which can be obtained from the volume's name itself dncore_ethchaindnpdappnodeeth_data
.
I believe that only the owner of a named volume should be allowed to remove it. Therefore, it should have the power to delete all DNPs that are using that volume (after the user is clearly warned) in order to perform the volume deletion.
DNPs and volumes
vipnode.dnp.dappnode.eth
volumes:
vipnodednpdappnodeeth_data
(owned)dncore_ethchaindnpdappnodeeth_data
(external)ethchain.dnp.dappnode.eth
volumes:
dncore_ethchaindnpdappnodeeth_data
(owned)If the user tries to remove vipnode.dnp.dappnode.eth
volumes, only vipnodednpdappnodeeth_data
will be removed and a modal or note will indicate that external volume dncore_ethchaindnpdappnodeeth_data
can only be deleted in the ethchain.dnp.dappnode.eth
DNP.
If the user tries to remove ethchain.dnp.dappnode.eth
volumes, a dialog will show confirming that vipnode.dnp.dappnode.eth
will be removed in order for the volume deletion to be possible. Then the DAPPMANAGER will do
# Pseudo code
docker rm vipnode.dnp.dappnode.eth
delete-volumes ethchain.dnp.dappnode.eth
docker-compose up vipnode.dnp.dappnode.eth
@vdo Has reviewed the concept and says ok
Checked!!
@Shelpin pointed out that it confusing to offer the option of removing data of a DNP that has none.
Fixed with https://github.com/dappnode/DNP_ADMIN/pull/333
Only display the 'Remove and delete data' button if necessary
afther the latest commit the button is not appearing anymore but the text mentions the buttonn remove + delete data that actually does not exist anymore
When deleting a volume of ETHCHAIN, if it's shared with another package (for example VIPnode) it will give an error and then the ETHCHAIN package will disappear.
logs:
A way to prevent that would be to check the number containers using it: