Skip to content

Commit

Permalink
Merge pull request #157 from weaveworks/fix-event-type
Browse files Browse the repository at this point in the history
Fix the event type for error cases.
  • Loading branch information
bigkevmcd authored Dec 14, 2023
2 parents 317333c + c446768 commit 5be78bb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions controllers/gitopsset_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ func (r *GitOpsSetReconciler) event(obj *templatesv1.GitOpsSet, severity, msg st
reason = severity
}

eventType := "Normal"
eventType := corev1.EventTypeNormal
if severity == eventv1.EventSeverityError {
eventType = "Error"
eventType = corev1.EventTypeWarning
}

r.EventRecorder.Event(obj, eventType, reason, msg)
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/gitopsset_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1028,7 +1028,7 @@ func TestEventsWithFailingReconciling(t *testing.T) {
// reconciliation should fail because there is an existing resource.
want := []*test.EventData{
{
EventType: "Error",
EventType: corev1.EventTypeWarning,
Reason: "ReconciliationFailed",
},
}
Expand Down

0 comments on commit 5be78bb

Please sign in to comment.