mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-04-27 11:31:05 +00:00
ci: retry genpolicy execution
genpolicy is sending more HTTPS requests than other components during CI so it's more likely to be affected by transient network errors similar to: ConnectError( "dns error", Custom { kind: Uncategorized, error: "failed to lookup address information: Try again", }, ) Note that genpolicy is not the only component hitting network errors during CI. Recent example from a different component: "Message: failed to create containerd task: failed to create shim task: failed to async pull blob stream HTTP status server error (502 Bad Gateway)" This CI change might help just with the genpolicy errors. Fixes: #11182 Signed-off-by: Dan Mihai <dmihai@microsoft.com>
This commit is contained in:
parent
bf93b5daf1
commit
517d6201f5
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user