add error checking and retries to elastic_fleet_integration_policy_upgrade

This commit is contained in:
reyesj2
2025-09-16 21:22:03 -05:00
parent 94e8cd84e6
commit bcd2e95fbe
3 changed files with 8 additions and 4 deletions

View File

@@ -15,7 +15,10 @@ do
elastic_fleet_integration_check "endpoints-initial" "$INTEGRATION"
if [ -n "$INTEGRATION_ID" ]; then
printf "\n\nIntegration $NAME exists - Upgrading integration policy\n"
elastic_fleet_integration_policy_upgrade "$INTEGRATION_ID"
if ! elastic_fleet_integration_policy_upgrade "$INTEGRATION_ID"; then
echo -e "\nFailed to upgrade integration policy for ${INTEGRATION##*/}"
exit 1
fi
else
printf "\n\nIntegration does not exist - Creating integration\n"
if ! elastic_fleet_integration_create "@$INTEGRATION"; then