-
Notifications
You must be signed in to change notification settings - Fork 128
Description
Describe the bug
The scheduling controller records Kubernetes Events for PlacementDecision even when there are no actual changes, causing unnecessary event accumulation.
Current Behavior
File: pkg/placement/controllers/scheduling/scheduling_controller.go
Function: createOrUpdatePlacementDecision()
Lines: 711-754
updated, err := placementDecisionPatcher.PatchStatus(ctx, newPlacementDecision, newPlacementDecision.Status, existPlacementDecision.Status)
if updated {
return err // Early return when status is updated
}
// Return value ignored - cannot tell if labels actually changed
_, err = placementDecisionPatcher.PatchLabelAnnotations(ctx, newPlacementDecision, newPlacementDecision.ObjectMeta, existPlacementDecision.ObjectMeta)
if err != nil {
return err
}
// ❌ PROBLEM: Events are ALWAYS recorded here, even when nothing changed
c.eventsRecorder.Eventf(..., "DecisionUpdate", "DecisionUpdated", ...)
c.eventsRecorder.Eventf(..., "ScoreUpdate", "ScoreUpdated", ...)
To Reproduce
Steps to reproduce the behavior:
Expected behavior
A clear and concise description of what you expected to happen.
Environment ie: OCM version, Kubernetes version and provider:
Additional context
Add any other context about the problem here.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status