From 64aab0e4c3786865aff8159b08196a2173dc2fdd Mon Sep 17 00:00:00 2001 From: Nick Hinsch Date: Mon, 13 Dec 2021 11:37:19 -0500 Subject: [PATCH 1/4] Remove log lines from bootstrap script --- scripts/boot.sh | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/scripts/boot.sh b/scripts/boot.sh index d2cc4a064..3e2ebcd3d 100644 --- a/scripts/boot.sh +++ b/scripts/boot.sh @@ -2,9 +2,17 @@ args=("$@") if [ "$DD_EXPERIMENTAL_ENABLE_PROXY" == "true" ] then - echo "[bootstrap] DD_EXPERIMENTAL_ENABLE_PROXY is true" - echo "[bootstrap] orignal AWS_LAMBDA_RUNTIME_API $AWS_LAMBDA_RUNTIME_API" + if [ fgrep -ix "$DD_LOG_LEVEL" <<< "debug" ] + then + echo "[bootstrap] DD_EXPERIMENTAL_ENABLE_PROXY is true" + echo "[bootstrap] original AWS_LAMBDA_RUNTIME_API value is $AWS_LAMBDA_RUNTIME_API" + fi + export AWS_LAMBDA_RUNTIME_API="127.0.0.1:9000" - echo "[bootstrap] rerouting to $AWS_LAMBDA_RUNTIME_API" + + if [ fgrep -ix "$DD_LOG_LEVEL" <<< "debug" ] + then + echo "[bootstrap] rerouting AWS_LAMBDA_RUNTIME_API to $AWS_LAMBDA_RUNTIME_API" + fi fi exec "${args[@]}" \ No newline at end of file From ea0729836dd09a6b913c354dd53e7ee22a99a380 Mon Sep 17 00:00:00 2001 From: Nick Hinsch Date: Mon, 13 Dec 2021 11:39:14 -0500 Subject: [PATCH 2/4] Regular grep --- scripts/boot.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/boot.sh b/scripts/boot.sh index 3e2ebcd3d..52d450891 100644 --- a/scripts/boot.sh +++ b/scripts/boot.sh @@ -10,7 +10,7 @@ then export AWS_LAMBDA_RUNTIME_API="127.0.0.1:9000" - if [ fgrep -ix "$DD_LOG_LEVEL" <<< "debug" ] + if [ grep -ix "$DD_LOG_LEVEL" <<< "debug" ] then echo "[bootstrap] rerouting AWS_LAMBDA_RUNTIME_API to $AWS_LAMBDA_RUNTIME_API" fi From 9c4011eb445c4e046e6efd79b09db19f5a559c7b Mon Sep 17 00:00:00 2001 From: Nick Hinsch Date: Mon, 13 Dec 2021 11:43:31 -0500 Subject: [PATCH 3/4] Use grep --- scripts/boot.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/boot.sh b/scripts/boot.sh index 52d450891..91ad5256a 100644 --- a/scripts/boot.sh +++ b/scripts/boot.sh @@ -2,7 +2,7 @@ args=("$@") if [ "$DD_EXPERIMENTAL_ENABLE_PROXY" == "true" ] then - if [ fgrep -ix "$DD_LOG_LEVEL" <<< "debug" ] + if [ grep -ix "$DD_LOG_LEVEL" <<< "debug" ] then echo "[bootstrap] DD_EXPERIMENTAL_ENABLE_PROXY is true" echo "[bootstrap] original AWS_LAMBDA_RUNTIME_API value is $AWS_LAMBDA_RUNTIME_API" From 09f1b64362d078ab10971cca0bacd1752eaaad9b Mon Sep 17 00:00:00 2001 From: Nick Hinsch Date: Mon, 13 Dec 2021 15:10:54 -0500 Subject: [PATCH 4/4] Fix lowercasing --- scripts/boot.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/boot.sh b/scripts/boot.sh index 91ad5256a..17d1e0aa5 100644 --- a/scripts/boot.sh +++ b/scripts/boot.sh @@ -1,8 +1,12 @@ #!/bin/bash args=("$@") + +# lowercase DD_LOG_LEVEL +DD_LOG_LEVEL=$(echo "$DD_LOG_LEVEL" | tr '[:upper:]' '[:lower:]') + if [ "$DD_EXPERIMENTAL_ENABLE_PROXY" == "true" ] then - if [ grep -ix "$DD_LOG_LEVEL" <<< "debug" ] + if [ "$DD_LOG_LEVEL" == "debug" ] then echo "[bootstrap] DD_EXPERIMENTAL_ENABLE_PROXY is true" echo "[bootstrap] original AWS_LAMBDA_RUNTIME_API value is $AWS_LAMBDA_RUNTIME_API" @@ -10,7 +14,7 @@ then export AWS_LAMBDA_RUNTIME_API="127.0.0.1:9000" - if [ grep -ix "$DD_LOG_LEVEL" <<< "debug" ] + if [ "$DD_LOG_LEVEL" == "debug" ] then echo "[bootstrap] rerouting AWS_LAMBDA_RUNTIME_API to $AWS_LAMBDA_RUNTIME_API" fi