Skip to content

Commit a01d766

Browse files
pwhelanedsiper
authored andcommitted
in_calyptia_fleet: create configuration directory before the fleet header.
Signed-off-by: Phillip Whelan <[email protected]>
1 parent 3ce15c6 commit a01d766

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

plugins/in_calyptia_fleet/in_calyptia_fleet.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1938,11 +1938,6 @@ static int load_fleet_config(struct flb_in_calyptia_fleet_config *ctx)
19381938
flb_ctx_t *flb_ctx = flb_context_get();
19391939
flb_sds_t cfgnewname = NULL;
19401940

1941-
if (create_fleet_directory(ctx) != 0) {
1942-
flb_plg_error(ctx->ins, "unable to create fleet directories");
1943-
return -1;
1944-
}
1945-
19461941
/* check if we are already using the fleet configuration file. */
19471942
if (is_fleet_config(ctx, flb_ctx->config) == FLB_FALSE) {
19481943
flb_plg_debug(ctx->ins, "loading configuration file");
@@ -2227,6 +2222,12 @@ static int in_calyptia_fleet_init(struct flb_input_instance *in,
22272222
/* Set the context */
22282223
flb_input_set_context(in, ctx);
22292224

2225+
/* create fleet directory before creating the fleet header. */
2226+
if (create_fleet_directory(ctx) != 0) {
2227+
flb_plg_error(ctx->ins, "unable to create fleet directories");
2228+
return -1;
2229+
}
2230+
22302231
/* refresh calyptia settings before attempting to load the fleet
22312232
* configuration file.
22322233
*/

0 commit comments

Comments
 (0)