Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fleet: use header with main configuration settings. #8102

Merged
merged 7 commits into from
Dec 11, 2023
Prev Previous commit
Next Next commit
in_calyptia_fleet: download and load fleet files.
Download fleet files to a sub-directory with the timestamp of the relevant
configuration and allow it to be loaded by changing to that directory
when fluent-bit is reloaded.

  * Recurse through fleet files and download each one.
  * Change to the fleet files directory on reload so they can be referred
    to from the main fleet configuration file.
  * Delete old fleet file directories when the configuration is deleted.

Signed-off-by: Phillip Whelan <phil@calyptia.com>
  • Loading branch information
pwhelan committed Dec 1, 2023
commit 54bad8d7b5724af73b40b7ea5ec50b27fc954be9
3 changes: 3 additions & 0 deletions plugins/in_calyptia_fleet/in_calyptia_fleet.c
Original file line number Diff line number Diff line change
Expand Up @@ -648,6 +648,8 @@ static int execute_reload(struct flb_in_calyptia_fleet_config *ctx, flb_sds_t cf
flb_plg_error(ctx->ins, "unable to change to configuration directory");
}

fleet_cur_chdir(ctx);

pthread_attr_init(&ptha);
pthread_attr_setdetachstate(&ptha, PTHREAD_CREATE_DETACHED);
pthread_create(&pth, &ptha, do_reload, reload);
Expand Down Expand Up @@ -967,6 +969,7 @@ static int get_calyptia_fleet_id_by_name(struct flb_in_calyptia_fleet_config *ct

#ifdef FLB_SYSTEM_WINDOWS
#define link(a, b) CreateHardLinkA(b, a, 0)
#define symlink(a, b) CreateSymLinkA(b, a, 0)

ssize_t readlink(const char *path, char *realpath, size_t srealpath) {
HANDLE hFile;
Expand Down