Skip to content

Commit

Permalink
in_docker: stricter config json name matching (so it does not match s…
Browse files Browse the repository at this point in the history
…warm service name if any)

Signed-off-by: Filipe Pina <[email protected]>
  • Loading branch information
fopina committed Nov 2, 2024
1 parent 104aceb commit 6b54d44
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion plugins/in_docker/cgroup_v1.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ static char *get_config_file(struct flb_docker *ctx, char *id)

static char *extract_name(char *line, char *start)
{
int skip = 9;
int skip = sizeof(DOCKER_NAME_ARG)-1;
int len = 0;
char *name;
char buff[256];
Expand Down
2 changes: 1 addition & 1 deletion plugins/in_docker/cgroup_v2.c
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ static char *get_config_file(struct flb_docker *ctx, char *id)

static char *extract_name(char *line, char *start)
{
int skip = 9;
int skip = sizeof(DOCKER_NAME_ARG)-1;
int len = 0;
char *name;
char buff[256];
Expand Down
2 changes: 1 addition & 1 deletion plugins/in_docker/docker.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
#define DOCKER_CGROUP_V2_CPU_USAGE_TEMPLATE DOCKER_CGROUP_V2_CPU_USAGE_KEY" %lu"

#define DOCKER_CONFIG_JSON "config.v2.json"
#define DOCKER_NAME_ARG "\"Name\""
#define DOCKER_NAME_ARG "\"Name\":\"/"
#define DEFAULT_INTERVAL_SEC "1"
#define DEFAULT_INTERVAL_NSEC "0"

Expand Down

0 comments on commit 6b54d44

Please sign in to comment.