Skip to content

Commit a332e0a

Browse files
mprahlopenshift-merge-bot[bot]
authored andcommitted
Stop retrying to record invalid compliance events
This is to account for the database IDs being invalid due to data loss in the database. Relates: https://issues.redhat.com/browse/ACM-10109 Signed-off-by: mprahl <[email protected]>
1 parent 5a56e37 commit a332e0a

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

controllers/statussync/policy_status_sync.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -716,6 +716,19 @@ func StartComplianceEventsSyncer(
716716
}
717717
}
718718

719+
// If it's a bad request, then the database experienced data loss and the database ID is no longer valid.
720+
if httpResponse.StatusCode == http.StatusBadRequest {
721+
log.V(0).Info(
722+
"Failed to record the compliance event with the compliance API. Will not requeue.",
723+
"statusCode", httpResponse.StatusCode,
724+
"message", message,
725+
)
726+
events.Forget(ceUntyped)
727+
events.Done(ceUntyped)
728+
729+
continue
730+
}
731+
719732
log.Info(
720733
"Failed to record the compliance event with the compliance API. Will requeue.",
721734
"statusCode", httpResponse.StatusCode,

0 commit comments

Comments
 (0)