Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #8445 +/- ##
==========================================
+ Coverage 60.34% 62.64% +2.30%
==========================================
Files 357 378 +21
Lines 42589 48004 +5415
==========================================
+ Hits 25699 30073 +4374
- Misses 14566 15335 +769
- Partials 2324 2596 +272
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
pkg/kbagent/util/event.go
Outdated
| eventsClient := clientSet.CoreV1().Events(namespace()) | ||
|
|
||
| eventName := generateEventName(reason, message) | ||
| event, err := eventsClient.Get(context.Background(), eventName, metav1.GetOptions{}) |
There was a problem hiding this comment.
I think the Get() call should be part of the retry logic. For example, the call may fail due to temporary network failures, retry can help in this case.
|
I must say I prefer the previous implementation, which packages the get and create/update operations together as a single retry unit, rather than retrying them separately. Update conflicts are a common type of error in the Kubernetes world, and re-getting the latest version of the data and then updating is the standard pattern for resolving such issues. |
So actually, |
The code logic has been adjusted based on whether synchronous event sending is needed. |
| "github.com/go-logr/logr" | ||
| "github.com/pkg/errors" | ||
| corev1 "k8s.io/api/core/v1" | ||
| k8serrors "k8s.io/apimachinery/pkg/api/errors" |
|
/cherry-pick release-1.0-beta |
|
🤖 says: cherry pick action finished successfully 🎉! |
(cherry picked from commit d9fda81)
Current issues [solved]
Expectation
47s (x12 over 47s) => 47s (x12 over xxx not 47 s)
Should not be displayed as two identical times, because each time newEvent is executed.
Reason
event_controller.go