From 5564f2b54e32ec9c178d1baf1322558491fc1b57 Mon Sep 17 00:00:00 2001 From: Siddhesh Ghadi Date: Mon, 10 Jun 2024 16:21:26 +0530 Subject: [PATCH] correct rebase changes Signed-off-by: Siddhesh Ghadi --- util/argo/audit_logger.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/util/argo/audit_logger.go b/util/argo/audit_logger.go index 470e6f39e2f44..ba0d483922b9c 100644 --- a/util/argo/audit_logger.go +++ b/util/argo/audit_logger.go @@ -45,7 +45,7 @@ const ( EventReasonOperationCompleted = "OperationCompleted" ) -func (l *AuditLogger) logEvent(objMeta ObjectRef, gvk schema.GroupVersionKind, info EventInfo, message string, logFields map[string]string) { +func (l *AuditLogger) logEvent(objMeta ObjectRef, gvk schema.GroupVersionKind, info EventInfo, message string, logFields map[string]string, eventLabels map[string]string) { logCtx := log.WithFields(log.Fields{ "type": info.Type, "reason": info.Reason, @@ -66,6 +66,7 @@ func (l *AuditLogger) logEvent(objMeta ObjectRef, gvk schema.GroupVersionKind, i event := v1.Event{ ObjectMeta: metav1.ObjectMeta{ Name: fmt.Sprintf("%v.%x", objMeta.Name, t.UnixNano()), + Labels: eventLabels, Annotations: logFields, }, Source: v1.EventSource{ @@ -108,7 +109,7 @@ func (l *AuditLogger) LogAppEvent(app *v1alpha1.Application, info EventInfo, mes if user != "" { fields["user"] = user } - l.logEvent(objectMeta, v1alpha1.ApplicationSchemaGroupVersionKind, info, message, fields) + l.logEvent(objectMeta, v1alpha1.ApplicationSchemaGroupVersionKind, info, message, fields, eventLabels) } func (l *AuditLogger) LogAppSetEvent(app *v1alpha1.ApplicationSet, info EventInfo, message, user string) {