From edc918313d4356441836f0fcf67b50026f503db3 Mon Sep 17 00:00:00 2001
From: Mark Goddard <mark@stackhpc.com>
Date: Tue, 11 May 2021 10:20:48 +0100
Subject: [PATCH] CI: allow Elasticsearch status to be green or yellow

It has been seen to go green, so allow this.

Change-Id: Id86b95dbba3434b16f3d0c11485a0d8601833cbf
---
 tests/test-prometheus-efk.sh | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/tests/test-prometheus-efk.sh b/tests/test-prometheus-efk.sh
index 6fd6f214cb..86406223ad 100755
--- a/tests/test-prometheus-efk.sh
+++ b/tests/test-prometheus-efk.sh
@@ -42,8 +42,9 @@ function check_elasticsearch {
     if ! curl "${args[@]}" $ELASTICSEARCH_URL > $output_path; then
         return 1
     fi
-    # NOTE(mgoddard): Status is yellow because no indices have been created.
-    if ! grep '"status":"yellow"' $output_path >/dev/null; then
+    # NOTE(mgoddard): Status may be yellow because no indices have been
+    # created.
+    if ! grep -E '"status":"(green|yellow)"' $output_path >/dev/null; then
         return 1
     fi
 }