'Fetch latest events from the apiserver for the namespaces and kinds set on init
and returns an array of event objects'

def get_event_array(self):

    if self._request_interval:
        if ((time.time() - self._last_lookup_timestamp) < self._request_interval):
            return []
        else:
            self._last_lookup_timestamp = time.time()
    lastest_resversion = None
    filtered_events = []
    events = self.kubeutil.retrieve_json_auth(self.request_url, params=self.request_params)
    for event in events.get('items', []):
        resversion = int(event.get('metadata', {}).get('resourceVersion', None))
        if (resversion > self.last_resversion):
            lastest_resversion = max(lastest_resversion, resversion)
            if (self.namespace_filter is not None):
                ns = event.get('involvedObject', {}).get('namespace', 'default')
                if (ns not in self.namespace_filter):
                    continue
            if (self.kind_filter is not None):
                kind = event.get('involvedObject', {}).get('kind', None)
                if ((kind is None) or (kind not in self.kind_filter)):
                    continue
            filtered_events.append(event)
    self.last_resversion = max(self.last_resversion, lastest_resversion)
    return filtered_events
