From b9d0dfb3aa7c169bfc9d4dccf70d4468245ea145 Mon Sep 17 00:00:00 2001 From: igorpeshansky Date: Thu, 26 Oct 2023 14:20:34 -0400 Subject: [PATCH] out_stackdriver: Don't overwrite ctx->client_email and ctx->private_key. (#8093) Signed-off-by: Igor Peshansky --- plugins/out_stackdriver/stackdriver_conf.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/plugins/out_stackdriver/stackdriver_conf.c b/plugins/out_stackdriver/stackdriver_conf.c index 9f3f28a354c..e05c21db9c3 100644 --- a/plugins/out_stackdriver/stackdriver_conf.c +++ b/plugins/out_stackdriver/stackdriver_conf.c @@ -394,12 +394,13 @@ struct flb_stackdriver *flb_stackdriver_conf_create(struct flb_output_instance * flb_stackdriver_conf_destroy(ctx); return NULL; } - + /* Service Account Email */ if (ctx->client_email == NULL) { tmp = getenv("SERVICE_ACCOUNT_EMAIL"); if (tmp) { ctx->creds->client_email = flb_sds_create(tmp); + ctx->client_email = ctx->creds->client_email; } } @@ -408,11 +409,9 @@ struct flb_stackdriver *flb_stackdriver_conf_create(struct flb_output_instance * tmp = getenv("SERVICE_ACCOUNT_SECRET"); if (tmp) { ctx->creds->private_key = flb_sds_create(tmp); + ctx->private_key = ctx->creds->private_key; } } - - ctx->private_key = ctx->creds->private_key; - ctx->client_email = ctx->creds->client_email; } /*