Fix bug in reflector not detecting "Too large resource version" error before 1.17.0

Kubernetes-commit: 11e5e92dc65c1caaeb248a60d90ccc8e29eb9ff0
This commit is contained in:
xuzhenglun
2023-01-16 11:36:28 +08:00
committed by Kubernetes Publisher
parent a13376f3fa
commit 7685b51912
2 changed files with 17 additions and 3 deletions

View File

@@ -23,6 +23,7 @@ import (
"io"
"math/rand"
"reflect"
"strings"
"sync"
"time"
@@ -693,5 +694,11 @@ func isTooLargeResourceVersionError(err error) bool {
return true
}
}
// Matches the message returned by api server before 1.17.0
if strings.Contains(apierr.Status().Message, "Too large resource version") {
return true
}
return false
}