Skip to content

Commit

Permalink
Merge pull request #2553 from Tharsanan1/fix-helm-upgrade
Browse files Browse the repository at this point in the history
Fix indefintely increasing status events
  • Loading branch information
Tharsanan1 authored Oct 8, 2024
2 parents c95831f + 03f7b6a commit 75d6bf1
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion adapter/internal/operator/controllers/dp/api_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -2713,7 +2713,14 @@ func (apiReconciler *APIReconciler) handleStatus() {
hCopy.Status.DeploymentStatus.Status = successEvent.State
hCopy.Status.DeploymentStatus.Accepted = accept
hCopy.Status.DeploymentStatus.Message = message
hCopy.Status.DeploymentStatus.Events = append(hCopy.Status.DeploymentStatus.Events, event)
events := hCopy.Status.DeploymentStatus.Events
// Keep the first 2 and last 3 events, remove the rest
if len(events) > 6 {
// Truncate the events and add the special event
events = append(events[:2], events[len(events)-3:]...)
}

hCopy.Status.DeploymentStatus.Events = append(events, event)
hCopy.Status.DeploymentStatus.TransitionTime = &timeNow
return hCopy
},
Expand Down

0 comments on commit 75d6bf1

Please sign in to comment.