ci: retry command in Pod on "unable to upgrade connection" error

Sometimes executing a command in a Pod fails with "unable to upgrade
connection". This is most likely a temporary situation, and retrying
hopefully reduces the number of spurious failures because of it.

Signed-off-by: Niels de Vos <ndevos@redhat.com>
This commit is contained in:
Niels de Vos
2022-07-26 15:28:59 +02:00
committed by mergify[bot]
parent 856d7c264c
commit a04a0ecc9f
2 changed files with 37 additions and 6 deletions

View File

@ -41,6 +41,11 @@ func isRetryableAPIError(err error) bool {
return true
}
// "unable to upgrade connection" happens occasionally when executing commands in Pods
if strings.Contains(err.Error(), "unable to upgrade connection") {
return true
}
// "transport is closing" is an internal gRPC err, we can not use ErrConnClosing
if strings.Contains(err.Error(), "transport is closing") {
return true