Skip to content

Commit

Permalink
out_stackdriver: Don't overwrite ctx->client_email and ctx->private_k…
Browse files Browse the repository at this point in the history
…ey. (#8093)

Signed-off-by: Igor Peshansky <[email protected]>
  • Loading branch information
igorpeshansky authored Oct 26, 2023
1 parent d98e273 commit b9d0dfb
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions plugins/out_stackdriver/stackdriver_conf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

Expand All @@ -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;
}

/*
Expand Down

0 comments on commit b9d0dfb

Please sign in to comment.