k8s.io/apiserver/storage/etcd: refactor etcd GetList.

Reorder some code.

Signed-off-by: Siyuan Zhang <sizhang@google.com>
This commit is contained in:
Siyuan Zhang
2023-10-20 12:39:51 -07:00
parent 84ec5e2ecc
commit a968f51fa2
2 changed files with 22 additions and 29 deletions

View File

@@ -527,12 +527,6 @@ func testListOptionsCase(t *testing.T, rsClient appsv1.ReplicaSetInterface, watc
}
return
}
if opts.ResourceVersion == invalidResourceVersion {
if err == nil || !strings.Contains(err.Error(), "Invalid value") {
t.Fatalf("expecting invalid value error, but got: %v", err)
}
return
}
if opts.Continue == invalidContinueToken {
if err == nil || !strings.Contains(err.Error(), "continue key is not valid") {
t.Fatalf("expected continue key not valid error, but got: %v", err)
@@ -546,6 +540,12 @@ func testListOptionsCase(t *testing.T, rsClient appsv1.ReplicaSetInterface, watc
}
return
}
if opts.ResourceVersion == invalidResourceVersion {
if err == nil || !strings.Contains(err.Error(), "Invalid value") {
t.Fatalf("expecting invalid value error, but got: %v", err)
}
return
}
// Check for too old errors
isExact := opts.ResourceVersionMatch == metav1.ResourceVersionMatchExact