From a404104337053dc736835424e948f0dd739ee500 Mon Sep 17 00:00:00 2001 From: CeerDecy <1748788674@qq.com> Date: Mon, 24 Mar 2025 17:17:54 +0800 Subject: [PATCH] fix: add unmark deployment --- .../tools/orchestrator/services/runtime/runtime.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/internal/tools/orchestrator/services/runtime/runtime.go b/internal/tools/orchestrator/services/runtime/runtime.go index 302ed1df21c..bb4203ff6ef 100644 --- a/internal/tools/orchestrator/services/runtime/runtime.go +++ b/internal/tools/orchestrator/services/runtime/runtime.go @@ -2104,6 +2104,16 @@ func (r *Runtime) fullGCForSingleRuntime(runtimeID uint64, keep int) { return } oldestID := top[len(top)-1].ID + + var unMarked = make(map[string]struct{}) + for i, deployment := range top { + if i < keep { + unMarked[deployment.ReleaseId] = struct{}{} + continue + } + break + } + var hasSuccess bool for _, deployment := range top { if deployment.Status == apistructs.DeploymentStatusOK { @@ -2120,6 +2130,9 @@ func (r *Runtime) fullGCForSingleRuntime(runtimeID uint64, keep int) { hasSuccess = true continue } + if _, ok := unMarked[deployments[i].ReleaseId]; ok { + continue + } r.markOutdated(&deployments[i]) } }