Merge pull request #11184 from microsoft/danmihai1/retry-genpolicy

ci: retry genpolicy execution
This commit is contained in:
Dan Mihai
2025-04-24 08:01:22 -07:00
committed by GitHub

View File

@@ -207,8 +207,15 @@ auto_generate_policy() {
genpolicy_command+=" ${additional_flags}"
info "Executing: ${genpolicy_command}"
eval "${genpolicy_command}"
# Retry if genpolicy fails, because typical failures of this tool are caused by
# transient network errors.
for _ in {1..6}; do
info "Executing: ${genpolicy_command}"
eval "${genpolicy_command}" && return 0
info "Sleeping after command failed..."
sleep 10s
done
return 1
}
# Change genpolicy settings to allow "kubectl exec" to execute a command