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

@@ -81,7 +81,9 @@ elastic_fleet_integration_policy_upgrade() {
'{"packagePolicyIds":[$INTEGRATIONID]}'
)
curl -K /opt/so/conf/elasticsearch/curl.config -L -X POST "localhost:5601/api/fleet/package_policies/upgrade" -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d "$JSON_STRING"
if ! curl -sK /opt/so/conf/elasticsearch/curl.config -L -X POST "localhost:5601/api/fleet/package_policies/upgrade" -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d "$JSON_STRING" --retry 3 --fail 2>/dev/null; then
return 1
fi
}