mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-10-31 02:08:13 +00:00 
			
		
		
		
	remove unused pv informer from expand_controller
This commit is contained in:
		| @@ -342,7 +342,6 @@ func startVolumeExpandController(ctx context.Context, controllerContext Controll | ||||
| 	expandController, expandControllerErr := expand.NewExpandController( | ||||
| 		controllerContext.ClientBuilder.ClientOrDie("expand-controller"), | ||||
| 		controllerContext.InformerFactory.Core().V1().PersistentVolumeClaims(), | ||||
| 		controllerContext.InformerFactory.Core().V1().PersistentVolumes(), | ||||
| 		controllerContext.Cloud, | ||||
| 		plugins, | ||||
| 		csiTranslator, | ||||
|   | ||||
| @@ -81,9 +81,6 @@ type expandController struct { | ||||
| 	pvcLister  corelisters.PersistentVolumeClaimLister | ||||
| 	pvcsSynced cache.InformerSynced | ||||
|  | ||||
| 	pvLister corelisters.PersistentVolumeLister | ||||
| 	pvSynced cache.InformerSynced | ||||
|  | ||||
| 	// cloud provider used by volume host | ||||
| 	cloud cloudprovider.Interface | ||||
|  | ||||
| @@ -108,7 +105,6 @@ type expandController struct { | ||||
| func NewExpandController( | ||||
| 	kubeClient clientset.Interface, | ||||
| 	pvcInformer coreinformers.PersistentVolumeClaimInformer, | ||||
| 	pvInformer coreinformers.PersistentVolumeInformer, | ||||
| 	cloud cloudprovider.Interface, | ||||
| 	plugins []volume.VolumePlugin, | ||||
| 	translator CSINameTranslator, | ||||
| @@ -120,8 +116,6 @@ func NewExpandController( | ||||
| 		cloud:                    cloud, | ||||
| 		pvcLister:                pvcInformer.Lister(), | ||||
| 		pvcsSynced:               pvcInformer.Informer().HasSynced, | ||||
| 		pvLister:                 pvInformer.Lister(), | ||||
| 		pvSynced:                 pvInformer.Informer().HasSynced, | ||||
| 		queue:                    workqueue.NewNamedRateLimitingQueue(workqueue.DefaultControllerRateLimiter(), "volume_expand"), | ||||
| 		translator:               translator, | ||||
| 		csiMigratedPluginManager: csiMigratedPluginManager, | ||||
| @@ -339,7 +333,7 @@ func (expc *expandController) Run(ctx context.Context) { | ||||
| 	logger.Info("Starting expand controller") | ||||
| 	defer logger.Info("Shutting down expand controller") | ||||
|  | ||||
| 	if !cache.WaitForNamedCacheSync("expand", ctx.Done(), expc.pvcsSynced, expc.pvSynced) { | ||||
| 	if !cache.WaitForNamedCacheSync("expand", ctx.Done(), expc.pvcsSynced) { | ||||
| 		return | ||||
| 	} | ||||
|  | ||||
|   | ||||
| @@ -95,7 +95,6 @@ func TestSyncHandler(t *testing.T) { | ||||
| 		fakeKubeClient := controllervolumetesting.CreateTestClient() | ||||
| 		informerFactory := informers.NewSharedInformerFactory(fakeKubeClient, controller.NoResyncPeriodFunc()) | ||||
| 		pvcInformer := informerFactory.Core().V1().PersistentVolumeClaims() | ||||
| 		pvInformer := informerFactory.Core().V1().PersistentVolumes() | ||||
|  | ||||
| 		pvc := test.pvc | ||||
| 		if tc.pv != nil { | ||||
| @@ -107,7 +106,7 @@ func TestSyncHandler(t *testing.T) { | ||||
| 		} | ||||
| 		allPlugins := []volume.VolumePlugin{} | ||||
| 		translator := csitrans.New() | ||||
| 		expc, err := NewExpandController(fakeKubeClient, pvcInformer, pvInformer, nil, allPlugins, translator, csimigration.NewPluginManager(translator, utilfeature.DefaultFeatureGate), nil) | ||||
| 		expc, err := NewExpandController(fakeKubeClient, pvcInformer, nil, allPlugins, translator, csimigration.NewPluginManager(translator, utilfeature.DefaultFeatureGate), nil) | ||||
| 		if err != nil { | ||||
| 			t.Fatalf("error creating expand controller : %v", err) | ||||
| 		} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 carlory
					carlory