Kong / go-database-reconciler

Apache License 2.0
5 stars 3 forks source link

fix: send change events always #119

Closed rainest closed 2 months ago

rainest commented 2 months ago

Summary

Fixes a bug in the event sender. The original structure of this section meant that GDR only sent change events to the channel if they had encountered in an error. This did not make the KIC DB mode error event generator unhappy, but did not work very well for https://github.com/Kong/kubernetes-ingress-controller/pull/6131, as it did not see most change events. Whoops.

This assigns the error to the event regardless of whether it's nil or not (it'll either populate or just remain nil) and sends the event off before checking for a non-nil error and performing the error return.

After this change, the channel will receive successful events also. This was the original intent, but the breakage went unnoticed til I tried to actual look at successful events.

codecov-commenter commented 2 months ago

Codecov Report

Attention: Patch coverage is 0% with 10 lines in your changes missing coverage. Please review.

Project coverage is 41.35%. Comparing base (61fbc91) to head (96cece3).

Files Patch % Lines
pkg/diff/diff.go 0.00% 10 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #119 +/- ## ========================================== - Coverage 41.35% 41.35% -0.01% ========================================== Files 75 75 Lines 10895 10896 +1 ========================================== Hits 4506 4506 - Misses 5925 5926 +1 Partials 464 464 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.