scheduler: Fix field apiVersion is missing from events reported from taint manager

Signed-off-by: aimuz <mr.imuz@gmail.com>
This commit is contained in:
aimuz 2022-11-24 10:25:11 +08:00
parent fa78f28f0a
commit 975b2c6611
No known key found for this signature in database
GPG Key ID: 63C3DC9FBA22D9D7

View File

@ -514,9 +514,10 @@ func (tc *NoExecuteTaintManager) emitPodDeletionEvent(nsName types.NamespacedNam
return return
} }
ref := &v1.ObjectReference{ ref := &v1.ObjectReference{
Kind: "Pod", APIVersion: "v1",
Name: nsName.Name, Kind: "Pod",
Namespace: nsName.Namespace, Name: nsName.Name,
Namespace: nsName.Namespace,
} }
tc.recorder.Eventf(ref, v1.EventTypeNormal, "TaintManagerEviction", "Marking for deletion Pod %s", nsName.String()) tc.recorder.Eventf(ref, v1.EventTypeNormal, "TaintManagerEviction", "Marking for deletion Pod %s", nsName.String())
} }
@ -526,9 +527,10 @@ func (tc *NoExecuteTaintManager) emitCancelPodDeletionEvent(nsName types.Namespa
return return
} }
ref := &v1.ObjectReference{ ref := &v1.ObjectReference{
Kind: "Pod", APIVersion: "v1",
Name: nsName.Name, Kind: "Pod",
Namespace: nsName.Namespace, Name: nsName.Name,
Namespace: nsName.Namespace,
} }
tc.recorder.Eventf(ref, v1.EventTypeNormal, "TaintManagerEviction", "Cancelling deletion of Pod %s", nsName.String()) tc.recorder.Eventf(ref, v1.EventTypeNormal, "TaintManagerEviction", "Cancelling deletion of Pod %s", nsName.String())
} }