ManageIQ / manageiq-providers-kubernetes

ManageIQ plugin for the Kubernetes provider.
https://kubernetes.io/
Apache License 2.0
7 stars 63 forks source link

Reject any events which do not have a timestamp #501

Closed agrare closed 1 year ago

agrare commented 1 year ago

The event timestamp is critical for uniquely identifying events and ensuring there are no duplicates.

We cannot properly handle events without a timestamp so we need to not queue these for the event handler.

Fryguy commented 1 year ago

@agrare Will we still log that we attempted the event? I'm wondering if we should be printing a "Skipping" or "Ignoring" message to the log at a minimum.

agrare commented 1 year ago

I'm going to rework this a bit since there won't be anything useful to log if we just return nil

miq-bot commented 1 year ago

Checked commits https://github.com/agrare/manageiq-providers-kubernetes/compare/11206be1f6a0214f92cfc29093e83b97acec955a~...f6631b6af4b877832945254da986929593462612 with ruby 2.6.10, rubocop 1.28.2, haml-lint 0.35.0, and yamllint 2 files checked, 1 offense detected

app/models/manageiq/providers/kubernetes/container_manager/event_catcher_mixin.rb

agrare commented 1 year ago

@Fryguy ready for review

Fryguy commented 1 year ago

Backported to petrosian in commit 272dade1b16cfb20c7c72bc5a7cfb43678fd5c6a.

commit 272dade1b16cfb20c7c72bc5a7cfb43678fd5c6a
Author: Jason Frey <fryguy9@gmail.com>
Date:   Fri Aug 11 13:48:42 2023 -0400

    Merge pull request #501 from agrare/reject_events_without_a_timestamp

    Reject any events which do not have a timestamp

    (cherry picked from commit c2df77bc3d66e712872a86e9ffac690342aca737)