Skip to content

Commit 782e8cb

Browse files
zhihonledsiper
authored andcommitted
aws: rename credential constant and clean up unit test
Signed-off-by: Zhihong Lin <zhiholin@amazon.com>
1 parent abd5ee2 commit 782e8cb

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/aws/flb_aws_credentials_http.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
#define ECS_CREDENTIALS_HOST_LEN 13
4141
#define EKS_CREDENTIALS_HOST "169.254.170.23"
4242
#define EKS_CREDENTIALS_HOST_LEN 14
43-
#define AWS_CREDENTIALS_PATH "AWS_CONTAINER_CREDENTIALS_RELATIVE_URI"
43+
#define AWS_CREDENTIALS_RELATIVE_URI "AWS_CONTAINER_CREDENTIALS_RELATIVE_URI"
4444
#define AWS_CREDENTIALS_FULL_URI "AWS_CONTAINER_CREDENTIALS_FULL_URI"
4545

4646
#define AUTH_TOKEN_ENV_VAR "AWS_CONTAINER_AUTHORIZATION_TOKEN"
@@ -333,7 +333,7 @@ struct flb_aws_provider *flb_http_provider_create(struct flb_config *config,
333333
char *full_uri = NULL;
334334
int ret;
335335

336-
relative_uri = getenv(AWS_CREDENTIALS_PATH);
336+
relative_uri = getenv(AWS_CREDENTIALS_RELATIVE_URI);
337337
full_uri = getenv(AWS_CREDENTIALS_FULL_URI);
338338

339339
if (relative_uri && strlen(relative_uri) > 0) {
@@ -370,7 +370,7 @@ struct flb_aws_provider *flb_http_provider_create(struct flb_config *config,
370370
}
371371
else {
372372
flb_debug("[aws_credentials] Not initializing ECS/EKS HTTP Provider because"
373-
" %s and %s is not set", AWS_CREDENTIALS_PATH, AWS_CREDENTIALS_FULL_URI);
373+
" %s and %s is not set", AWS_CREDENTIALS_RELATIVE_URI, AWS_CREDENTIALS_FULL_URI);
374374
return NULL;
375375
}
376376

tests/internal/aws_credentials_http.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -758,8 +758,7 @@ static void test_http_validator_invalid_port()
758758
TEST_LIST = {
759759
{ "test_http_provider", test_http_provider},
760760
{ "test_http_provider_error_case", test_http_provider_error_case},
761-
{ "test_http_provider_malformed_response", test_http_provider_malformed_response},
762-
{ "test_http_provider", test_http_provider},
761+
{ "test_http_provider_malformed_response",test_http_provider_malformed_response},
763762
{ "test_http_provider_ecs_case", test_http_provider_ecs_case},
764763
{ "test_http_provider_eks_with_token", test_http_provider_eks_with_token},
765764
{ "test_http_provider_eks_with_token_file", test_http_provider_eks_with_token_file},

0 commit comments

Comments
 (0)