Skip to content

Commit

Permalink
Adding 1 second delay between pod health checks requeue (#2163)
Browse files Browse the repository at this point in the history
Right now is running too often causing a lot of logs in Operator, usually MinIO will take some seconds to restart.

Signed-off-by: pjuarezd <pjuarezd@users.noreply.github.com>
  • Loading branch information
pjuarezd authored Jun 13, 2024
1 parent 54e4091 commit cabe56d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/controller/monitoring.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ func (c *Controller) syncHealthCheckHandler(key string) (Result, error) {

// Add tenant to the health check queue again until is green again
if tenant != nil && tenant.Status.HealthStatus != miniov2.HealthStatusGreen {
c.healthCheckQueue.Add(key)
c.healthCheckQueue.AddAfter(key, 1*time.Second)
}

return WrapResult(Result{}, nil)
Expand Down
3 changes: 2 additions & 1 deletion pkg/controller/pods.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package controller

import (
"fmt"
"time"

miniov2 "github.com/minio/operator/pkg/apis/minio.min.io/v2"
"github.com/minio/operator/pkg/utils"
Expand All @@ -40,5 +41,5 @@ func (c *Controller) handlePodChange(obj interface{}) {
}

key := fmt.Sprintf("%s/%s", object.GetNamespace(), instanceName)
c.healthCheckQueue.Add(key)
c.healthCheckQueue.AddAfter(key, 1*time.Second)
}

0 comments on commit cabe56d

Please sign in to comment.