From 8c0efb9715e3ff89223c924aacf6e7c573d57602 Mon Sep 17 00:00:00 2001 From: Josh Brand Date: Tue, 23 Aug 2022 14:46:24 -0400 Subject: [PATCH] Enos: add additional guards before authentication (#2382) * Enos: add additional guards before authentication Previously, we would see failures when the ALB in front of a cluster was alive and passing healthchecks, but the database behind had not been initialized yet. This adds a check with an unauth'd call to `auth-methods list` to validate the DB is up before auth. --- enos/templates/get-token.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/enos/templates/get-token.sh b/enos/templates/get-token.sh index 85b9b33d3..be1718506 100644 --- a/enos/templates/get-token.sh +++ b/enos/templates/get-token.sh @@ -21,8 +21,8 @@ function retry { return 0 } -# make sure the ALB is up and passing healthchecks -retry 10 curl -s -o /dev/null ${BOUNDARY_ADDR} +# make sure boundary is connected to DB (unauthenticated endpoint) +retry 10 ${BOUNDARY_PATH}/boundary auth-methods list > /dev/null export BP="${PASSWORD}" ${BOUNDARY_PATH}/boundary authenticate password -auth-method-id=${METHOD_ID} -login-name=${LOGIN_NAME} -password=env://BP -token-name=none -format=json -keyring-type=none