(object runtime.Object, annotations map[string]string, timestamp metav1.Time, eventtype, reason, message string)
| 291 | } |
| 292 | |
| 293 | func (recorder *recorderImpl) generateEvent(object runtime.Object, annotations map[string]string, timestamp metav1.Time, eventtype, reason, message string) { |
| 294 | ref, err := ref.GetReference(recorder.scheme, object) |
| 295 | if err != nil { |
| 296 | klog.Errorf("Could not construct reference to: '%#v' due to: '%v'. Will not report event: '%v' '%v' '%v'", object, err, eventtype, reason, message) |
| 297 | return |
| 298 | } |
| 299 | |
| 300 | if !util.ValidateEventType(eventtype) { |
| 301 | klog.Errorf("Unsupported event type: '%v'", eventtype) |
| 302 | return |
| 303 | } |
| 304 | |
| 305 | event := recorder.makeEvent(ref, annotations, eventtype, reason, message) |
| 306 | event.Source = recorder.source |
| 307 | |
| 308 | go func() { |
| 309 | // NOTE: events should be a non-blocking operation |
| 310 | defer utilruntime.HandleCrash() |
| 311 | recorder.Action(watch.Added, event) |
| 312 | }() |
| 313 | } |
| 314 | |
| 315 | func (recorder *recorderImpl) Event(object runtime.Object, eventtype, reason, message string) { |
| 316 | recorder.generateEvent(object, nil, metav1.Now(), eventtype, reason, message) |
no test coverage detected