canonical / microceph

Ceph for a one-rack cluster and appliances
https://snapcraft.io/microceph
GNU Affero General Public License v3.0
193 stars 25 forks source link

Use microcluster API to remove cluster members #340

Open masnax opened 2 months ago

masnax commented 2 months ago

Closes #255

As discussed in Riga, this refactors the node removal process to rely on the microcluster API instead of directly implementing removal in the MicroCeph CLI.

The main changes are that the removeNode function and all its helpers have been moved to the ceph package. The removeNode function itself has been wrapped in a PreRemove to match the corresponding hook in microcluster. Now in the CLI, we can simply call DeleteClusterMember and the PreRemove hook will automatically execute on that node as it is passed to microcluster when we call app.Start.

This will allow MicroCloud to utilize MicroCeph's API to tear down the cluster in case of an error during initialization. Additionally, it cleans up MicroCeph so there isn't so much internal implementation in the CLI package.

masnax commented 2 months ago

Setting as draft until I can sort out the last test.

masnax commented 3 weeks ago

@UtkarshBhatthere @sabaini This one is now ready for review, thank you :)

masnax commented 1 week ago

This should now be rebased and ready for review, thanks :)

masnax commented 13 hours ago

@sabaini Thanks for merging the other one, I've now rebased this one.