@@ -40,7 +40,6 @@ import (
40
40
clientset "k8s.io/client-go/kubernetes"
41
41
"k8s.io/client-go/util/workqueue"
42
42
"k8s.io/kubernetes/pkg/controller/volume/persistentvolume"
43
- persistentvolumeoptions "k8s.io/kubernetes/pkg/controller/volume/persistentvolume/options"
44
43
"k8s.io/kubernetes/pkg/scheduler/algorithm/predicates"
45
44
"k8s.io/kubernetes/pkg/volume"
46
45
volumetest "k8s.io/kubernetes/pkg/volume/testing"
@@ -926,7 +925,7 @@ func setupCluster(t *testing.T, nsName string, numberOfNodes int, resyncPeriod t
926
925
927
926
func initPVController (context * testContext , provisionDelaySeconds int ) (* persistentvolume.PersistentVolumeController , informers.SharedInformerFactory , error ) {
928
927
clientset := context .clientSet
929
- // Informers factory for controllers, we disable resync period for testing.
928
+ // Informers factory for controllers
930
929
informerFactory := informers .NewSharedInformerFactory (clientset , 0 )
931
930
932
931
// Start PV controller for volume binding.
@@ -946,10 +945,11 @@ func initPVController(context *testContext, provisionDelaySeconds int) (*persist
946
945
}
947
946
plugins := []volume.VolumePlugin {plugin }
948
947
949
- controllerOptions := persistentvolumeoptions .NewPersistentVolumeControllerOptions ()
950
948
params := persistentvolume.ControllerParameters {
951
- KubeClient : clientset ,
952
- SyncPeriod : controllerOptions .PVClaimBinderSyncPeriod ,
949
+ KubeClient : clientset ,
950
+ // Use a frequent resync period to retry API update conflicts due to
951
+ // https://github.com/kubernetes/kubernetes/issues/85320
952
+ SyncPeriod : 5 * time .Second ,
953
953
VolumePlugins : plugins ,
954
954
Cloud : nil ,
955
955
ClusterName : "volume-test-cluster" ,
0 commit comments