Fix instance deletion check to account for restarting status

This commit is contained in:
2025-10-27 17:42:27 +01:00
parent f1666565d8
commit 1814772fa2

View File

@@ -330,7 +330,8 @@ func (im *instanceManager) DeleteInstance(name string) error {
lock.Lock()
defer im.unlockAndCleanup(name)
if inst.IsRunning() {
status := inst.GetStatus()
if status == instance.Running || status == instance.Restarting {
return fmt.Errorf("instance with name %s is still running, stop it before deleting", name)
}