Skip to content

Commit

Permalink
add queueing if status not green
Browse files Browse the repository at this point in the history
  • Loading branch information
cesnietor committed Jun 10, 2024
1 parent f7cfab4 commit 0ec383d
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions pkg/controller/monitoring.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,17 @@ func (c *Controller) tenantsHealthMonitor() error {
if err != nil {
return err
}
for _, tenant := range tenants.Items {
if _, err = c.updateHealthStatusForTenant(&tenant); err != nil {
for _, t := range tenants.Items {
tenant, err := c.updateHealthStatusForTenant(&t)
if err != nil {
klog.Errorf("%v", err)
return err
}
// Add tenant to the health check queue until is green again
if tenant != nil && tenant.Status.HealthStatus != miniov2.HealthStatusGreen {
key := fmt.Sprintf("%s/%s", tenant.GetNamespace(), tenant.GetName())
c.healthCheckQueue.Add(key)
}
}
return nil
}
Expand Down

0 comments on commit 0ec383d

Please sign in to comment.