From 134f2bd3de34169e7ce4507edd22613daa461d92 Mon Sep 17 00:00:00 2001 From: Eric Blackburn Date: Mon, 25 Sep 2023 15:01:31 -0400 Subject: [PATCH 1/3] fix(appset): don't emit k8s events for unchanged application events and move that scenario to debug logging level Signed-off-by: Eric Blackburn --- .../controllers/applicationset_controller.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/applicationset/controllers/applicationset_controller.go b/applicationset/controllers/applicationset_controller.go index 044262615cf32..0763920dc304f 100644 --- a/applicationset/controllers/applicationset_controller.go +++ b/applicationset/controllers/applicationset_controller.go @@ -694,8 +694,16 @@ func (r *ApplicationSetReconciler) createOrUpdateInCluster(ctx context.Context, continue } r.updateCache(ctx, found, appLog) - r.Recorder.Eventf(&applicationSet, corev1.EventTypeNormal, fmt.Sprint(action), "%s Application %q", action, generatedApp.Name) - appLog.Logf(log.InfoLevel, "%s Application", action) + + if action != controllerutil.OperationResultNone { + // Don't pollute etcd with "unchanged Application" events + r.Recorder.Eventf(&applicationSet, corev1.EventTypeNormal, fmt.Sprint(action), "%s Application %q", action, generatedApp.Name) + appLog.Logf(log.InfoLevel, "%s Application", action) + } else { + // "unchanged Application" can be inferred by Reconcile Complete with no action being listed + // Or enable debug logging + appLog.Logf(log.DebugLevel, "%s Application", action) + } } return firstError } From 6f85b03f1173f11bd09e18d8413fb01b8ba8bf2f Mon Sep 17 00:00:00 2001 From: Eric Blackburn Date: Tue, 26 Sep 2023 13:07:32 -0400 Subject: [PATCH 2/3] Retrigger CI pipeline Signed-off-by: Eric Blackburn From a84342807567daf2a52def5134dfe3d726e1c99a Mon Sep 17 00:00:00 2001 From: Eric Blackburn Date: Tue, 26 Sep 2023 14:59:08 -0400 Subject: [PATCH 3/3] Retrigger CI pipeline Signed-off-by: Eric Blackburn