From 77e76a95d6c30392ce0dfba145c99fee92306f9b Mon Sep 17 00:00:00 2001 From: Chris Mark Date: Thu, 23 Jul 2020 16:06:47 +0300 Subject: [PATCH] Agent entrypoint fix (#20187) --- .../templates/docker/docker-entrypoint.elastic-agent.tmpl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dev-tools/packaging/templates/docker/docker-entrypoint.elastic-agent.tmpl b/dev-tools/packaging/templates/docker/docker-entrypoint.elastic-agent.tmpl index c907f4ffe88..4936c8f9139 100644 --- a/dev-tools/packaging/templates/docker/docker-entrypoint.elastic-agent.tmpl +++ b/dev-tools/packaging/templates/docker/docker-entrypoint.elastic-agent.tmpl @@ -49,8 +49,9 @@ function enroll(){ if [ $exitCode -ne 0 ]; then exit $exitCode fi + + apikey=$(echo $enrollResp | jq -r '.item.api_key') fi - apikey=$(echo $enrollResp | jq -r '.item.api_key') echo $apikey ./{{ .BeatName }} enroll ${KIBANA_HOST:-http://localhost:5601} $apikey -f