mirror of
https://github.com/floci-io/floci.git
synced 2026-12-02 09:47:56 -05:00
CreateNodegroup on a cluster whose node runs a different instance type replaces the k3s node while holding the cluster's capacity lock. DeleteCluster did not take that lock. A delete during the swap found no container to stop, so the replacement node kept running, and the swap then wrote the deleted cluster back to storage, stuck in DELETING. DeleteCluster now takes the capacity lock before it reads the cluster and marks it DELETING, so it waits for the swap and then stops the node the swap started. A second delete that waited behind the first finds the cluster gone and answers ResourceNotFoundException. The lock is taken before the clustersBeingDeleted monitor, the order the swap already uses. Co-authored-by: Robin Baeckman <27041454+RobinBaeckman@users.noreply.github.com>