From b43829001a6e44a448dea15ac8d1339fca541713 Mon Sep 17 00:00:00 2001 From: adriananeci Date: Thu, 6 Oct 2022 13:41:56 +0300 Subject: [PATCH] Fix a bug when computing the rolling restart threshold (#10) --- pkg/handler/handler.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/handler/handler.go b/pkg/handler/handler.go index 2ef1238..e9fee78 100644 --- a/pkg/handler/handler.go +++ b/pkg/handler/handler.go @@ -190,7 +190,7 @@ func (h *Handler) processNode(node v1.Node, rr chan *controllerObject) error { } if h.appContext.Config.NamespacePrefixSkipInitialEviction == "" || !strings.HasPrefix(pod.Namespace, h.appContext.Config.NamespacePrefixSkipInitialEviction) { - rrThresholdTime := -h.appContext.Config.ParkedNodeTTL * time.Duration(100-h.appContext.Config.RollingRestartThreshold*100) / 100 + rrThresholdTime := h.appContext.Config.ParkedNodeTTL * time.Duration(100-h.appContext.Config.RollingRestartThreshold*100) / 100 if time.Now().UTC().Before(expiresOn.Add(-rrThresholdTime)) { err := h.evictPod(pod, deleteOptions) if err != nil {