e2e: isRetryableAPIError() should match any etcdserver timeout

framework.RunKubectl() returns an error that does not end with
"etcdserver: request timed out", but contains the text somewhere in the
middle:

    error running /usr/bin/kubectl --server=https://192.168.39.57:8443 --kubeconfig=/root/.kube/config --namespace=cephcsi-e2e-a44ec4b4 create -f -:
    Command stdout:

    stderr:
    Error from server: error when creating "STDIN": etcdserver: request timed out

    error:
    exit status 1

isRetryableAPIError() should  return `true` for this case as well, so
instead of using HasSuffix(), we'll use Contains().

Signed-off-by: Niels de Vos <ndevos@redhat.com>
This commit is contained in:
Niels de Vos 2021-07-22 09:48:38 +02:00 committed by mergify[bot]
parent 75dda7ac0d
commit e75d308b9c

View File

@ -37,7 +37,7 @@ func isRetryableAPIError(err error) bool {
}
// "etcdserver: request timed out" does not seem to match the timeout errors above
if strings.HasSuffix(err.Error(), "etcdserver: request timed out") {
if strings.Contains(err.Error(), "etcdserver: request timed out") {
return true
}