@@ -47,7 +47,6 @@ import (
47
47
examplev1 "k8s.io/apiserver/pkg/apis/example/v1"
48
48
"k8s.io/apiserver/pkg/features"
49
49
"k8s.io/apiserver/pkg/storage"
50
- "k8s.io/apiserver/pkg/storage/storagebackend"
51
50
storagetesting "k8s.io/apiserver/pkg/storage/testing"
52
51
"k8s.io/apiserver/pkg/storage/value"
53
52
utilfeature "k8s.io/apiserver/pkg/util/feature"
@@ -824,7 +823,7 @@ func TestTransformationFailure(t *testing.T) {
824
823
codec := apitesting .TestCodec (codecs , examplev1 .SchemeGroupVersion )
825
824
cluster := integration .NewClusterV3 (t , & integration.ClusterConfig {Size : 1 })
826
825
defer cluster .Terminate (t )
827
- store := newStore (cluster .RandClient (), newPod , false , storagebackend . DefaultLeaseReuseDurationSeconds , codec , "" , & prefixTransformer {prefix : []byte (defaultTestPrefix )})
826
+ store := newStore (cluster .RandClient (), codec , newPod , "" , & prefixTransformer {prefix : []byte (defaultTestPrefix )}, false , NewDefaultLeaseManagerConfig () )
828
827
ctx := context .Background ()
829
828
830
829
preset := []struct {
@@ -901,8 +900,8 @@ func TestList(t *testing.T) {
901
900
codec := apitesting .TestCodec (codecs , examplev1 .SchemeGroupVersion )
902
901
cluster := integration .NewClusterV3 (t , & integration.ClusterConfig {Size : 1 })
903
902
defer cluster .Terminate (t )
904
- store := newStore (cluster .RandClient (), newPod , true , storagebackend . DefaultLeaseReuseDurationSeconds , codec , "" , & prefixTransformer {prefix : []byte (defaultTestPrefix )})
905
- disablePagingStore := newStore (cluster .RandClient (), newPod , false , storagebackend . DefaultLeaseReuseDurationSeconds , codec , "" , & prefixTransformer {prefix : []byte (defaultTestPrefix )})
903
+ store := newStore (cluster .RandClient (), codec , newPod , "" , & prefixTransformer {prefix : []byte (defaultTestPrefix )}, true , NewDefaultLeaseManagerConfig () )
904
+ disablePagingStore := newStore (cluster .RandClient (), codec , newPod , "" , & prefixTransformer {prefix : []byte (defaultTestPrefix )}, false , NewDefaultLeaseManagerConfig () )
906
905
ctx := context .Background ()
907
906
908
907
// Setup storage with the following structure:
@@ -1400,7 +1399,7 @@ func TestListContinuation(t *testing.T) {
1400
1399
etcdClient := cluster .RandClient ()
1401
1400
recorder := & clientRecorder {KV : etcdClient .KV }
1402
1401
etcdClient .KV = recorder
1403
- store := newStore (etcdClient , newPod , true , storagebackend . DefaultLeaseReuseDurationSeconds , codec , "" , transformer )
1402
+ store := newStore (etcdClient , codec , newPod , "" , transformer , true , NewDefaultLeaseManagerConfig () )
1404
1403
ctx := context .Background ()
1405
1404
1406
1405
// Setup storage with the following structure:
@@ -1562,7 +1561,7 @@ func TestListContinuationWithFilter(t *testing.T) {
1562
1561
etcdClient := cluster .RandClient ()
1563
1562
recorder := & clientRecorder {KV : etcdClient .KV }
1564
1563
etcdClient .KV = recorder
1565
- store := newStore (etcdClient , newPod , true , storagebackend . DefaultLeaseReuseDurationSeconds , codec , "" , transformer )
1564
+ store := newStore (etcdClient , codec , newPod , "" , transformer , true , NewDefaultLeaseManagerConfig () )
1566
1565
ctx := context .Background ()
1567
1566
1568
1567
preset := []struct {
@@ -1665,7 +1664,7 @@ func TestListInconsistentContinuation(t *testing.T) {
1665
1664
codec := apitesting .TestCodec (codecs , examplev1 .SchemeGroupVersion )
1666
1665
cluster := integration .NewClusterV3 (t , & integration.ClusterConfig {Size : 1 })
1667
1666
defer cluster .Terminate (t )
1668
- store := newStore (cluster .RandClient (), newPod , true , storagebackend . DefaultLeaseReuseDurationSeconds , codec , "" , & prefixTransformer {prefix : []byte (defaultTestPrefix )})
1667
+ store := newStore (cluster .RandClient (), codec , newPod , "" , & prefixTransformer {prefix : []byte (defaultTestPrefix )}, true , NewDefaultLeaseManagerConfig () )
1669
1668
ctx := context .Background ()
1670
1669
1671
1670
// Setup storage with the following structure:
@@ -1813,7 +1812,9 @@ func testSetup(t *testing.T) (context.Context, *store, *integration.ClusterV3) {
1813
1812
// As 30s is the default timeout for testing in glboal configuration,
1814
1813
// we cannot wait longer than that in a single time: change it to 10
1815
1814
// for testing purposes. See apimachinery/pkg/util/wait/wait.go
1816
- store := newStore (cluster .RandClient (), newPod , true , 1 , codec , "" , & prefixTransformer {prefix : []byte (defaultTestPrefix )})
1815
+ store := newStore (cluster .RandClient (), codec , newPod , "" , & prefixTransformer {prefix : []byte (defaultTestPrefix )}, true , LeaseManagerConfig {
1816
+ ReuseDurationSeconds : 1 ,
1817
+ })
1817
1818
ctx := context .Background ()
1818
1819
return ctx , store , cluster
1819
1820
}
@@ -1855,7 +1856,7 @@ func TestPrefix(t *testing.T) {
1855
1856
"/registry" : "/registry" ,
1856
1857
}
1857
1858
for configuredPrefix , effectivePrefix := range testcases {
1858
- store := newStore (cluster .RandClient (), nil , true , storagebackend . DefaultLeaseReuseDurationSeconds , codec , configuredPrefix , transformer )
1859
+ store := newStore (cluster .RandClient (), codec , nil , configuredPrefix , transformer , true , NewDefaultLeaseManagerConfig () )
1859
1860
if store .pathPrefix != effectivePrefix {
1860
1861
t .Errorf ("configured prefix of %s, expected effective prefix of %s, got %s" , configuredPrefix , effectivePrefix , store .pathPrefix )
1861
1862
}
@@ -2022,7 +2023,7 @@ func TestConsistentList(t *testing.T) {
2022
2023
transformer := & fancyTransformer {
2023
2024
transformer : & prefixTransformer {prefix : []byte (defaultTestPrefix )},
2024
2025
}
2025
- store := newStore (cluster .RandClient (), newPod , true , storagebackend . DefaultLeaseReuseDurationSeconds , codec , "" , transformer )
2026
+ store := newStore (cluster .RandClient (), codec , newPod , "" , transformer , true , NewDefaultLeaseManagerConfig () )
2026
2027
transformer .store = store
2027
2028
2028
2029
for i := 0 ; i < 5 ; i ++ {
0 commit comments