Skip to content

Commit

Permalink
MLPAB-2239 - fix error handling in delete index steps (#1328)
Browse files Browse the repository at this point in the history
* fix error handling

* index not found is a success:
  • Loading branch information
andrewpearce-digital authored Jul 5, 2024
1 parent 4b37311 commit 721e172
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions .github/workflows/workflow_destroy_pr_environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,11 @@ jobs:
"${{ secrets.DEVELOPMENT_OPENSEARCH_COLLECTION_ENDPOINT }}/lpas_v2_${{ needs.generate_environment_workspace_name.outputs.environment_workspace_name }}" \
--request DELETE \
--region eu-west-1 \
--service aoss | jq -r '.status')
if [[ $response != "200" && $response != "404" ]]; then
echo "Error: Unexpected response status $response"
exit 1
fi
--service aoss)
if [[ $response == *'"acknowledged":true'*]]; then
echo "Request successful."
elif [[ $response == *'"status":404'* ]]; then
echo "Request successful but index not found."
else
exit 1
fi

0 comments on commit 721e172

Please sign in to comment.