Skip to content

Commit

Permalink
in_calyptia_fleet: create configuration directory before the fleet he…
Browse files Browse the repository at this point in the history
…ader.

Signed-off-by: Phillip Whelan <[email protected]>
  • Loading branch information
pwhelan committed Dec 21, 2023
1 parent 3ce15c6 commit 2bfb61f
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions plugins/in_calyptia_fleet/in_calyptia_fleet.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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.
*/
Expand Down

0 comments on commit 2bfb61f

Please sign in to comment.