continue loop after encountering error with first

This commit is contained in:
reyesj2
2025-04-21 20:32:42 -05:00
parent 166e4e0ebc
commit e17fea849a

View File

@@ -44,6 +44,7 @@ for AGENT_POLICY in $agent_policies; do
if [[ "$PACKAGE_VERSION" != "$AVAILABLE_VERSION" ]]; then
# Dry run of the upgrade
echo ""
echo "Current $PACKAGE_NAME package version ($PACKAGE_VERSION) is not the same as the latest available package ($AVAILABLE_VERSION)..."
echo "Upgrading $INTEGRATION..."
echo "Starting dry run..."
@@ -55,12 +56,12 @@ for AGENT_POLICY in $agent_policies; do
echo "No errors detected. Proceeding with upgrade..."
elastic_fleet_integration_policy_upgrade "$INTEGRATION_ID"
if [ $? -ne 0 ]; then
echo "Error: Upgrade failed for integration ID '$INTEGRATION_ID'."
exit 1
echo "Error: Upgrade failed for $PACKAGE_NAME with integration ID '$INTEGRATION_ID'."
continue
fi
else
echo "Errors detected during dry run. Stopping upgrade..."
exit 1
echo "Errors detected during dry run. Skipping $PACKAGE_NAME policy upgrade..."
continue
fi
fi
{%- if not AUTO_UPGRADE_INTEGRATIONS %}