Skip to content

Commit

Permalink
in_kubernetes_events: refactor time check to use struct flb_time.
Browse files Browse the repository at this point in the history
Signed-off-by: Phillip Whelan <[email protected]>
  • Loading branch information
pwhelan authored and edsiper committed Jun 5, 2024
1 parent 023cd6f commit 0b75c90
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions plugins/in_kubernetes_events/kubernetes_events.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit 0b75c90

Please sign in to comment.