Skip to content

Commit c5e5ca1

Browse files
nokute78edsiper
authored andcommitted
out_stackdriver: do not allocate metadata_server by config map
Signed-off-by: Takahiro Yamashita <[email protected]>
1 parent 99aabb0 commit c5e5ca1

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

plugins/out_stackdriver/stackdriver.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2427,7 +2427,7 @@ static struct flb_config_map config_map[] = {
24272427
},
24282428
{
24292429
FLB_CONFIG_MAP_STR, "metadata_server", (char *)NULL,
2430-
0, FLB_TRUE, offsetof(struct flb_stackdriver, metadata_server),
2430+
0, FLB_FALSE, 0,
24312431
"Set the metadata server"
24322432
},
24332433
{

plugins/out_stackdriver/stackdriver_conf.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,9 @@ struct flb_stackdriver *flb_stackdriver_conf_create(struct flb_output_instance *
261261
}
262262

263263
/* Lookup metadata server URL */
264-
if (ctx->metadata_server == NULL) {
264+
ctx->metadata_server = NULL;
265+
tmp = flb_output_get_property("metadata_server", ins);
266+
if (tmp == NULL) {
265267
tmp = getenv("METADATA_SERVER");
266268
if(tmp) {
267269
if (ctx->env == NULL) {
@@ -279,6 +281,9 @@ struct flb_stackdriver *flb_stackdriver_conf_create(struct flb_output_instance *
279281
ctx->metadata_server = flb_sds_create(FLB_STD_METADATA_SERVER);
280282
}
281283
}
284+
else {
285+
ctx->metadata_server = flb_sds_create(tmp);
286+
}
282287
flb_plg_info(ctx->ins, "metadata_server set to %s", ctx->metadata_server);
283288

284289
/* Lookup credentials file */

0 commit comments

Comments
 (0)