add fieldPath back to event logs

Kubernetes-commit: 94245af8f4a144e0aceb5a4be0d3ae4993e19be7
This commit is contained in:
Di Yi 2022-01-27 14:28:26 +08:00 committed by Kubernetes Publisher
parent 8f44946f6c
commit 93a63158d4

View File

@ -291,7 +291,7 @@ func (e *eventBroadcasterImpl) StartLogging(logf func(format string, args ...int
func (e *eventBroadcasterImpl) StartStructuredLogging(verbosity klog.Level) watch.Interface { func (e *eventBroadcasterImpl) StartStructuredLogging(verbosity klog.Level) watch.Interface {
return e.StartEventWatcher( return e.StartEventWatcher(
func(e *v1.Event) { 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)
}) })
} }