Skip to content

Commit c446768

Browse files
committed
Fix the event type for error cases.
There's no Error type, the event types are corev1.EventTypeNormal and corev1.EventTypeWarning. This was manifesting in the logs as an error saying that Error event types weren't supported.
1 parent 317333c commit c446768

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

controllers/gitopsset_controller.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,9 @@ func (r *GitOpsSetReconciler) event(obj *templatesv1.GitOpsSet, severity, msg st
7676
reason = severity
7777
}
7878

79-
eventType := "Normal"
79+
eventType := corev1.EventTypeNormal
8080
if severity == eventv1.EventSeverityError {
81-
eventType = "Error"
81+
eventType = corev1.EventTypeWarning
8282
}
8383

8484
r.EventRecorder.Event(obj, eventType, reason, msg)

tests/e2e/gitopsset_controller_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1028,7 +1028,7 @@ func TestEventsWithFailingReconciling(t *testing.T) {
10281028
// reconciliation should fail because there is an existing resource.
10291029
want := []*test.EventData{
10301030
{
1031-
EventType: "Error",
1031+
EventType: corev1.EventTypeWarning,
10321032
Reason: "ReconciliationFailed",
10331033
},
10341034
}

0 commit comments

Comments
 (0)