e2e: retry on "transport: missing content-type field" error

The e2e sometimes fail getting objects like PVCs from the Kubernetes API
server, and log the following error:

    Error getting pvc "rbd-6940" in namespace "rbd-694": rpc error: code = Unknown desc = OK: HTTP status code 200; transport: missing content-type field

By checking the error message, and initiating a retry on this failure,
CI jobs should fail less regulary.

Signed-off-by: Niels de Vos <ndevos@redhat.com>
This commit is contained in:
Niels de Vos 2021-11-18 10:50:27 +01:00 committed by mergify[bot]
parent 58074109d1
commit ba60566cfb

View File

@ -46,6 +46,13 @@ func isRetryableAPIError(err error) bool {
return true
}
// "transport: missing content-type field" is an error that sometimes
// is returned while talking to the kubernetes-api-server. There does
// not seem to be a public error constant for this.
if strings.Contains(err.Error(), "transport: missing content-type field") {
return true
}
return false
}