From a01d76673f667936c6b52e53cefd2eb22615fbe8 Mon Sep 17 00:00:00 2001 From: Phillip Whelan Date: Thu, 21 Dec 2023 14:57:32 -0300 Subject: [PATCH] in_calyptia_fleet: create configuration directory before the fleet header. Signed-off-by: Phillip Whelan --- plugins/in_calyptia_fleet/in_calyptia_fleet.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/plugins/in_calyptia_fleet/in_calyptia_fleet.c b/plugins/in_calyptia_fleet/in_calyptia_fleet.c index a9f85ab1428..06207fe00d1 100644 --- a/plugins/in_calyptia_fleet/in_calyptia_fleet.c +++ b/plugins/in_calyptia_fleet/in_calyptia_fleet.c @@ -1938,11 +1938,6 @@ static int load_fleet_config(struct flb_in_calyptia_fleet_config *ctx) flb_ctx_t *flb_ctx = flb_context_get(); flb_sds_t cfgnewname = NULL; - if (create_fleet_directory(ctx) != 0) { - flb_plg_error(ctx->ins, "unable to create fleet directories"); - return -1; - } - /* check if we are already using the fleet configuration file. */ if (is_fleet_config(ctx, flb_ctx->config) == FLB_FALSE) { flb_plg_debug(ctx->ins, "loading configuration file"); @@ -2227,6 +2222,12 @@ static int in_calyptia_fleet_init(struct flb_input_instance *in, /* Set the context */ flb_input_set_context(in, ctx); + /* create fleet directory before creating the fleet header. */ + if (create_fleet_directory(ctx) != 0) { + flb_plg_error(ctx->ins, "unable to create fleet directories"); + return -1; + } + /* refresh calyptia settings before attempting to load the fleet * configuration file. */