From 93a63158d4aa9116dd9cf027e3793f2f74bbdf11 Mon Sep 17 00:00:00 2001 From: Di Yi Date: Thu, 27 Jan 2022 14:28:26 +0800 Subject: [PATCH 1/2] add fieldPath back to event logs Kubernetes-commit: 94245af8f4a144e0aceb5a4be0d3ae4993e19be7 --- tools/record/event.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/record/event.go b/tools/record/event.go index 4b61d005..18555acc 100644 --- a/tools/record/event.go +++ b/tools/record/event.go @@ -291,7 +291,7 @@ func (e *eventBroadcasterImpl) StartLogging(logf func(format string, args ...int func (e *eventBroadcasterImpl) StartStructuredLogging(verbosity klog.Level) watch.Interface { return e.StartEventWatcher( func(e *v1.Event) { - klog.V(verbosity).InfoS("Event occurred", "object", klog.KRef(e.InvolvedObject.Namespace, e.InvolvedObject.Name), "kind", e.InvolvedObject.Kind, "apiVersion", e.InvolvedObject.APIVersion, "type", e.Type, "reason", e.Reason, "message", e.Message) + klog.V(verbosity).InfoS("Event occurred", "object", klog.KRef(e.InvolvedObject.Namespace, e.InvolvedObject.Name), "fieldPath", e.InvolvedObject.fieldPath, "kind", e.InvolvedObject.Kind, "apiVersion", e.InvolvedObject.APIVersion, "type", e.Type, "reason", e.Reason, "message", e.Message) }) } From 5b56e4a504b3017bcfbb8e753b8b09640babe481 Mon Sep 17 00:00:00 2001 From: Di Yi Date: Fri, 28 Jan 2022 15:50:43 +0800 Subject: [PATCH 2/2] resolve casing issue Kubernetes-commit: 9996c154cba000346db940c90e234265d67dd8a9 --- tools/record/event.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/record/event.go b/tools/record/event.go index 18555acc..b901d2e8 100644 --- a/tools/record/event.go +++ b/tools/record/event.go @@ -291,7 +291,7 @@ func (e *eventBroadcasterImpl) StartLogging(logf func(format string, args ...int func (e *eventBroadcasterImpl) StartStructuredLogging(verbosity klog.Level) watch.Interface { return e.StartEventWatcher( func(e *v1.Event) { - klog.V(verbosity).InfoS("Event occurred", "object", klog.KRef(e.InvolvedObject.Namespace, e.InvolvedObject.Name), "fieldPath", e.InvolvedObject.fieldPath, "kind", e.InvolvedObject.Kind, "apiVersion", e.InvolvedObject.APIVersion, "type", e.Type, "reason", e.Reason, "message", e.Message) + klog.V(verbosity).InfoS("Event occurred", "object", klog.KRef(e.InvolvedObject.Namespace, e.InvolvedObject.Name), "fieldPath", e.InvolvedObject.FieldPath, "kind", e.InvolvedObject.Kind, "apiVersion", e.InvolvedObject.APIVersion, "type", e.Type, "reason", e.Reason, "message", e.Message) }) }