Skip to content

Commit

Permalink
Fix a bug when computing the rolling restart threshold (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
adriananeci committed Oct 6, 2022
1 parent 4efea4f commit b438290
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/handler/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit b438290

Please sign in to comment.