1
0
mirror of https://github.com/kata-containers/kata-containers.git synced 2025-05-02 05:34:46 +00:00

Merge pull request 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
commit 706c2e2d68
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -207,8 +207,15 @@ auto_generate_policy() {
genpolicy_command+=" ${additional_flags}" genpolicy_command+=" ${additional_flags}"
# 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}" info "Executing: ${genpolicy_command}"
eval "${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 # Change genpolicy settings to allow "kubectl exec" to execute a command