From 2cd460e468c1f8bb4ba540bb8126d7c423e33240 Mon Sep 17 00:00:00 2001 From: Phillip Whelan Date: Tue, 21 May 2024 11:01:24 -0400 Subject: [PATCH] in_kubernetes_events: refactor time check to use struct flb_time. Signed-off-by: Phillip Whelan --- plugins/in_kubernetes_events/kubernetes_events.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/in_kubernetes_events/kubernetes_events.c b/plugins/in_kubernetes_events/kubernetes_events.c index 6231becb0ad..21357891b25 100644 --- a/plugins/in_kubernetes_events/kubernetes_events.c +++ b/plugins/in_kubernetes_events/kubernetes_events.c @@ -291,7 +291,7 @@ static int item_get_timestamp(msgpack_object *obj, struct flb_time *event_time) } static bool check_event_is_filtered(struct k8s_events *ctx, msgpack_object *obj, - time_t* event_time) + struct flb_time *event_time) { int ret; time_t now; @@ -300,7 +300,7 @@ static bool check_event_is_filtered(struct k8s_events *ctx, msgpack_object *obj, uint64_t resource_version; now = (time_t)(cfl_time_now() / 1000000000); - if (*event_time < (now - ctx->retention_time)) { + if (event_time->tm.tv_sec < (now - ctx->retention_time)) { flb_plg_debug(ctx->ins, "Item is older than retention_time: %ld < %ld", *event_time, (now - ctx->retention_time)); return FLB_TRUE;