Merge pull request #108935 from stevekuznetsov/skuznets/too-large-rv

pkg/storage/etcd3: refactor "too large" resourceVersions
This commit is contained in:
Kubernetes Prow Robot 2022-03-24 02:59:18 -07:00 committed by GitHub
commit 4e6000a40c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -24,6 +24,7 @@ import (
"errors" "errors"
"fmt" "fmt"
"io/ioutil" "io/ioutil"
"math"
"os" "os"
"reflect" "reflect"
"strconv" "strconv"
@ -256,7 +257,7 @@ func TestGet(t *testing.T) {
name: "too high resource version", name: "too high resource version",
key: key, key: key,
expectRVTooLarge: true, expectRVTooLarge: true,
rv: fmt.Sprintf("%d", lastUpdatedCurrentRV+1), rv: strconv.FormatInt(math.MaxInt64, 10),
}, { // test get on non-existing item with ignoreNotFound=false }, { // test get on non-existing item with ignoreNotFound=false
name: "get non-existing", name: "get non-existing",
key: "/non-existing", key: "/non-existing",
@ -611,7 +612,7 @@ func TestGetListNonRecursive(t *testing.T) {
key: key, key: key,
pred: storage.Everything, pred: storage.Everything,
expectedOut: []*example.Pod{storedObj}, expectedOut: []*example.Pod{storedObj},
rv: fmt.Sprintf("%d", currentRV+1), rv: strconv.FormatInt(math.MaxInt64, 10),
expectRVTooLarge: true, expectRVTooLarge: true,
}, { }, {
name: "non-existing key", name: "non-existing key",
@ -1235,7 +1236,7 @@ func TestList(t *testing.T) {
{ {
name: "rejects resource version set too high", name: "rejects resource version set too high",
prefix: "/", prefix: "/",
rv: fmt.Sprintf("%d", continueRV+1), rv: strconv.FormatInt(math.MaxInt64, 10),
expectRVTooLarge: true, expectRVTooLarge: true,
}, },
{ {