From 8b24a8d3752d480b00eec0dc9b14ee7d7b2da43a Mon Sep 17 00:00:00 2001 From: Jeff Cantrill Date: Wed, 12 Aug 2020 17:05:13 -0400 Subject: [PATCH] Bug 1866019: Delete indices in batches --- pkg/indexmanagement/scripts.go | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/pkg/indexmanagement/scripts.go b/pkg/indexmanagement/scripts.go index 562cd4e32..28c8cb477 100644 --- a/pkg/indexmanagement/scripts.go +++ b/pkg/indexmanagement/scripts.go @@ -25,6 +25,11 @@ writeIndices=$(curl -s $ES_SERVICE/${POLICY_MAPPING}-*/_alias/${POLICY_MAPPING}- -H"Authorization: Bearer $(cat /var/run/secrets/kubernetes.io/serviceaccount/token)" \ -HContent-Type:application/json) +if echo "$writeIndices" | grep "\"error\"" ; then + echo "Error while attemping to determine the active write alias: $writeIndices" + exit 1 +fi + CMD=$(cat <