fix(api): 停服时 CR 已不存在返回 404 not_found,与唤醒一致

This commit is contained in:
Lemon-miaow committed 2026-09-27 12:49:46 +08:00
1 parent f692725bed
commit 5b0686dc06
3 files changed
+70 -1

No files matched your search

+1 -1
View File
@@ -112,7 +112,7 @@ func (a *API) handleStop(w http.ResponseWriter, r *http.Request) {
}
if err := a.Cluster.SetDesiredState(r.Context(), name, v1alpha1.DesiredStopped); err != nil {
writeError(w, r, err)
a.writeLookupError(w, r, err) // a row whose MinecraftServer is gone is 404, as for a wake
return
}
a.audit(r, "stop", name)