Skip to content

Commit ad2dc10

Browse files
vishwas121Vishwas Choudhary
authored andcommitted
feat: add k8s event for reconiliation failures on targetgroupbinding
1 parent 4884718 commit ad2dc10

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

controllers/elbv2/targetgroupbinding_controller.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ func (r *targetGroupBindingReconciler) reconcileTargetGroupBinding(ctx context.C
141141
}
142142
r.metricsCollector.ObserveControllerReconcileLatency(controllerName, "reconcile_targetgroupbinding", tgbResourceFn)
143143
if err != nil {
144+
r.eventRecorder.Event(tgb, corev1.EventTypeWarning, k8s.TargetGroupBindingEventReasonFailedReconcile, fmt.Sprintf("Failed reconcile due to %v", err))
144145
return ctrlerrors.NewErrorWithMetrics(controllerName, "reconcile_targetgroupbinding_error", err, r.metricsCollector)
145146
}
146147

pkg/k8s/events.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ const (
2727
TargetGroupBindingEventReasonFailedCleanup = "FailedCleanup"
2828
TargetGroupBindingEventReasonFailedNetworkReconcile = "FailedNetworkReconcile"
2929
TargetGroupBindingEventReasonBackendNotFound = "BackendNotFound"
30+
TargetGroupBindingEventReasonFailedReconcile = "FailedReconcile"
3031
TargetGroupBindingEventReasonSuccessfullyReconciled = "SuccessfullyReconciled"
3132

3233
// Gateway events

0 commit comments

Comments
 (0)