Make events returned by the REST API to use a common format

Events returned by the REST API are currently returning objects with expected fields set to null and other fields are filled instead. In particular:

  • lastTimestamp -> series.lastObservedTime
  • firstTimestamp -> eventTime
  • count -> series.count
  • reportingComponent -> source.component
  • reportingInstance -> source.host

Implementation plan

Remove eventTime, series and source fields from the event and fill lastTimestamp, firstTimestamp, count, reportingComponent and reportingInstance using the mapping provided above if values of those fields is not already present.

After the above transformation the events will be ordered.

Acceptance Criteria

All events returned by REST API will have the fields lastTimestamp, firstTimestamp, count, reportingComponent and reportingInstance filled using the mapping provided above if not already present.

Links

See also https://kubernetes.io/docs/reference/using-api/_print/#event-v125