From f909b93c3511fae4d88bb3dfb5265672c02f5bd3 Mon Sep 17 00:00:00 2001 From: Phillip Whelan Date: Thu, 26 Oct 2023 09:54:22 -0300 Subject: [PATCH] custom_calyptia: correctly set fleet_id for out_calyptia when fleet_name is set. Signed-off-by: Phillip Whelan --- plugins/custom_calyptia/calyptia.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/plugins/custom_calyptia/calyptia.c b/plugins/custom_calyptia/calyptia.c index 2ca8d3f68a8..3ba207b9203 100644 --- a/plugins/custom_calyptia/calyptia.c +++ b/plugins/custom_calyptia/calyptia.c @@ -313,7 +313,6 @@ static struct flb_output_instance *setup_cloud_output(struct flb_config *config, } if (ctx->fleet_id) { - flb_output_set_property(cloud, "fleet_id", ctx->fleet_id); label = flb_sds_create_size(strlen("fleet_id") + strlen(ctx->fleet_id) + 1); if (!label) { @@ -469,11 +468,10 @@ static int cb_calyptia_init(struct flb_custom_instance *ins, } if (ctx->fleet_name) { - // TODO: set this once the fleet_id has been retrieved... - // flb_output_set_property(ctx->o, "fleet_id", ctx->fleet_id); flb_input_set_property(ctx->fleet, "fleet_name", ctx->fleet_name); } - else { + + if (ctx->fleet_id) { flb_output_set_property(ctx->o, "fleet_id", ctx->fleet_id); flb_input_set_property(ctx->fleet, "fleet_id", ctx->fleet_id); }