mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-20 17:38:50 +00:00
Remove recorder.PastEventf
method
The `recorder.PastEventf` method wasn't actually working as advertised. It was supposed to accept a timestamp, which would be used when generating the event. However, as the [source code](https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/client-go/tools/record/event.go#L316) shows, this `timestamp` was never actually used. In other words, `PastEventf` is identical to `Eventf`. We have two options: one would be to fix `PastEventf` so that it works as advertised. The other would be to delete `PastEventf` and only support `Eventf`. Ultimately, I could only find one use of `PastEventf` in the code base, so I propose we just delete `PastEventf` and convert all uses to `Eventf`.
This commit is contained in:
@@ -368,10 +368,6 @@ func (f *FakeRecorder) Eventf(obj runtime.Object, eventtype, reason, messageFmt
|
||||
f.Event(obj, eventtype, reason, fmt.Sprintf(messageFmt, args...))
|
||||
}
|
||||
|
||||
// PastEventf is a no-op
|
||||
func (f *FakeRecorder) PastEventf(obj runtime.Object, timestamp metav1.Time, eventtype, reason, messageFmt string, args ...interface{}) {
|
||||
}
|
||||
|
||||
// AnnotatedEventf emits a fake formatted event to the fake recorder
|
||||
func (f *FakeRecorder) AnnotatedEventf(obj runtime.Object, annotations map[string]string, eventtype, reason, messageFmt string, args ...interface{}) {
|
||||
f.Eventf(obj, eventtype, reason, messageFmt, args...)
|
||||
|
Reference in New Issue
Block a user