Repository: gardener/machine-controller-manager (go)

Issue:
MCM doesn't wait for volumes to reattach
**How to categorize this issue?**
<!--
Please select area, kind, and priority for this issue. This helps the community categorizing it.
Replace below TODOs or exchange the existing identifiers with those that fit best in your opinion.
If multiple identifiers make sense you can also state the commands multiple times, e.g.
  /area control-plane
  /area auto-scaling
  ...

"/area" identifiers:     audit-logging|auto-scaling|backup|certification|control-plane-migration|control-plane|cost|delivery|dev-productivity|disaster-recovery|documentation|high-availability|logging|metering|monitoring|networking|open-source|ops-productivity|os|performance|quality|robustness|scalability|security|storage|testing|usability|user-management
"/kind" identifiers:     api-change|bug|cleanup|discussion|enhancement|epic|impediment|poc|post-mortem|question|regression|task|technical-debt|test
"/priority" identifiers: 1|2|3|4|5 (ordered from greatest to least)
-->
/area robustness
/kind bug
/priority 2

**What happened**:

After waiting for volumes to detach from a terminating node, MCM waits for the volumes to reattach to another node.
However, it immediately runs into a "timeout" instead of waiting (it's rather a context cancellation, but the logs say "timeout"):

```
I1010 16:22:37.863207       1 drain.go:752] Pod + volume detachment from Node garden for Pod prometheus-aggregate-0/shoot--garden--s-eu01-000-worker-z1-6f5b7-48qxs and took 10.193009281s
I1010 16:22:37.863483       1 drain.go:908] Waiting for following volumes to reattach: [pv-shoot--garden--s-eu01-000-5ca2886d-85d9-46d6-8ef3-175d194aaa03]
I1010 16:22:37.863751       1 drain.go:931] VolumeAttachment event received for PV: pv-shoot--garden--s-eu01-000-5ca2886d-85d9-46d6-8ef3-175d194aaa03
W1010 16:22:37.865246       1 drain.go:926] Timeout occurred while waiting for PVs [pv-shoot--garden--s-eu01-000-5ca2886d-85d9-46d6-8ef3-175d194aaa03] to reattach to a different node
W1010 16:22:37.865326       1 drain.go:771] Timeout occurred for following volumes to reattach: [pv-shoot--garden--s-eu01-000-5ca2886d-85d9-46d6-8ef3-175d194aaa03]
```

The effect is that MCM no longer waits for volumes to reattach and continues with the next pod right away.

**What you expected to happen**:

MCM should wait for volumes to reattach to other nodes before evicting the next pod.

**How to reproduce it (as minimally and precisely as possible)**:

Delete a machine with persistent volumes attached to it and observe the logs.

**Anything else we need to know?**:

The cause for this bug is that the context created for `waitForReattach` inherits from `ctx` ([ref](https://github.com/gardener/machine-controller-manager/blob/97cd75245dacc4e40327ded2f28a37a4a3f42cf1/pkg/util/provider/drain/drain.go#L760-L762)), which is the context created for `waitForDetach`. However, `ctx` is cancelled immediately after `waitForDetach` returns ([ref](https://github.com/gardener/machine-controller-manager/blob/97cd75245dacc4e40327ded2f28a37a4a3f42cf1/pkg/util/provider/drain/drain.go#L737-L739)), so the `ctx` for `waitForReattach` is cancelled right from the start.

It seems this was broken by https://github.com/gardener/machine-controller-manager/pull/920 (cc @sssash18).

**Environment**:

- Cloud provider or hardware configuration: all providers are affected, but reproduced with `europe-docker.pkg.dev/gardener-project/releases/gardener/machine-controller-manager-provider-openstack:v0.19.0`


Pull request description:
Fix context declaration for vol detachment and reattachment
**What this PR does / why we need it**:
Fixes a bug where volume reattachment context is declared using volume detachment context as the parent context. This PR also removes the support for `v1beta1` PDB as it was moved to `v1` from k8s `v1.21`

**Which issue(s) this PR fixes**:
Fixes #945 

**Special notes for your reviewer**:

**Release note**:
<!--  Write your release note:
1. Enter your release note in the below block.
2. If no release note is required, just write "NONE" within the block.

Format of block header: <category> <target_group>
Possible values:
- category:       breaking|feature|bugfix|doc|other
- target_group:   user|operator|developer|dependency
-->
```bugfix operator
Fixed a bug in drain logic where volume reattachment context declaration used incorrect parent context
```
```other operator
Removed support for v1beta1 PDBs
```

Patch:
diff --git a/pkg/util/provider/app/app.go b/pkg/util/provider/app/app.go
index a90630c91..b9781634e 100644
--- a/pkg/util/provider/app/app.go
+++ b/pkg/util/provider/app/app.go
@@ -37,7 +37,6 @@ import (
 	machineinformers "github.com/gardener/machine-controller-manager/pkg/client/informers/externalversions"
 	coreclientbuilder "github.com/gardener/machine-controller-manager/pkg/util/clientbuilder/core"
 	machineclientbuilder "github.com/gardener/machine-controller-manager/pkg/util/clientbuilder/machine"
-	"github.com/gardener/machine-controller-manager/pkg/util/k8sutils"
 	machinecontroller "github.com/gardener/machine-controller-manager/pkg/util/provider/machinecontroller"
 	coreinformers "k8s.io/client-go/informers"
 	kubescheme "k8s.io/client-go/kubernetes/scheme"
@@ -52,8 +51,6 @@ import (
 	utilruntime "k8s.io/apimachinery/pkg/util/runtime"
 	"k8s.io/apimachinery/pkg/util/wait"
 	"k8s.io/client-go/discovery"
-	policyv1informers "k8s.io/client-go/informers/policy/v1"
-	policyv1beta1informers "k8s.io/client-go/informers/policy/v1beta1"
 	"k8s.io/client-go/kubernetes"
 	v1core "k8s.io/client-go/kubernetes/typed/core/v1"
 	"k8s.io/client-go/pkg/version"
@@ -262,16 +259,7 @@ func StartControllers(s *options.MCServer,
 		s.MinResyncPeriod.Duration,
 	)
 
-	var (
-		pdbV1Informer      policyv1informers.PodDisruptionBudgetInformer
-		pdbV1beta1Informer policyv1beta1informers.PodDisruptionBudgetInformer
-	)
-
-	if k8sutils.ConstraintK8sGreaterEqual121.Check(targetKubernetesVersion) {
-		pdbV1Informer = targetCoreInformerFactory.Policy().V1().PodDisruptionBudgets()
-	} else {
-		pdbV1beta1Informer = targetCoreInformerFactory.Policy().V1beta1().PodDisruptionBudgets()
-	}
+	pdbInformer := targetCoreInformerFactory.Policy().V1().PodDisruptionBudgets()
 
 	// All shared informers are v1alpha1 API level
 	machineSharedInformers := controlMachineInformerFactory.Machine().V1alpha1()
@@ -287,8 +275,7 @@ func StartControllers(s *options.MCServer,
 		targetCoreInformerFactory.Core().V1().PersistentVolumes(),
 		controlCoreInformerFactory.Core().V1().Secrets(),
 		targetCoreInformerFactory.Core().V1().Nodes(),
-		pdbV1beta1Informer,
-		pdbV1Informer,
+		pdbInformer,
 		targetCoreInformerFactory.Storage().V1().VolumeAttachments(),
 		machineSharedInformers.MachineClasses(),
 		machineSharedInformers.Machines(),
diff --git a/pkg/util/provider/drain/drain.go b/pkg/util/provider/drain/drain.go
index 660a83a9c..a711fdcff 100644
--- a/pkg/util/provider/drain/drain.go
+++ b/pkg/util/provider/drain/drain.go
@@ -45,10 +45,8 @@ import (
 	"k8s.io/client-go/kubernetes"
 	corelisters "k8s.io/client-go/listers/core/v1"
 	policyv1listers "k8s.io/client-go/listers/policy/v1"
-	policyv1beta1listers "k8s.io/client-go/listers/policy/v1beta1"
 	"k8s.io/klog/v2"
 
-	"github.com/gardener/machine-controller-manager/pkg/util/k8sutils"
 	"github.com/gardener/machine-controller-manager/pkg/util/provider/driver"
 )
 
@@ -72,8 +70,7 @@ type Options struct {
 	Out                          io.Writer
 	pvcLister                    corelisters.PersistentVolumeClaimLister
 	pvLister                     corelisters.PersistentVolumeLister
-	pdbV1beta1Lister             policyv1beta1listers.PodDisruptionBudgetLister
-	pdbV1Lister                  policyv1listers.PodDisruptionBudgetLister
+	pdbLister                    policyv1listers.PodDisruptionBudgetLister
 	nodeLister                   corelisters.NodeLister
 	volumeAttachmentHandler      *VolumeAttachmentHandler
 	Timeout                      time.Duration
@@ -182,8 +179,7 @@ func NewDrainOptions(
 	driver driver.Driver,
 	pvcLister corelisters.PersistentVolumeClaimLister,
 	pvLister corelisters.PersistentVolumeLister,
-	pdbV1beta1Lister policyv1beta1listers.PodDisruptionBudgetLister,
-	pdbV1Lister policyv1listers.PodDisruptionBudgetLister,
+	pdbLister policyv1listers.PodDisruptionBudgetLister,
 	nodeLister corelisters.NodeLister,
 	volumeAttachmentHandler *VolumeAttachmentHandler,
 ) *Options {
@@ -205,8 +201,7 @@ func NewDrainOptions(
 		Driver:                       driver,
 		pvcLister:                    pvcLister,
 		pvLister:                     pvLister,
-		pdbV1beta1Lister:             pdbV1beta1Lister,
-		pdbV1Lister:                  pdbV1Lister,
+		pdbLister:                    pdbLister,
 		nodeLister:                   nodeLister,
 		volumeAttachmentHandler:      volumeAttachmentHandler,
 	}
@@ -502,17 +497,17 @@ func (o *Options) evictPods(ctx context.Context, attemptEvict bool, pods []corev
 	}
 
 	doneCount := 0
-	var errors []error
+	var evictErrors []error
 
 	numPods := len(pods)
 	for doneCount < numPods {
 		err := <-returnCh
 		doneCount++
 		if err != nil {
-			errors = append(errors, err)
+			evictErrors = append(evictErrors, err)
 		}
 	}
-	return utilerrors.NewAggregate(errors)
+	return utilerrors.NewAggregate(evictErrors)
 }
 
 func (o *Options) evictPodsWithoutPv(ctx context.Context, attemptEvict bool, pods []*corev1.Pod,
@@ -722,27 +717,14 @@ func (o *Options) evictPodsWithPVInternal(
 			// Pod eviction failed because of PDB violation, we will retry one we are done with this list.
 			klog.V(3).Infof("Pod %s/%s couldn't be evicted from node %s. This may also occur due to PDB violation. Will be retried. Error: %v", pod.Namespace, pod.Name, pod.Spec.NodeName, err)
 
-			if k8sutils.ConstraintK8sGreaterEqual121.Check(o.kubernetesVersion) {
-				pdb := getPdbV1ForPod(o.pdbV1Lister, pod)
-				if pdb != nil {
-					if isMisconfiguredPdbV1(pdb) {
-						pdbErr := fmt.Errorf("error while evicting pod %q: pod disruption budget %s/%s is misconfigured and requires zero voluntary evictions",
-							pod.Name, pdb.Namespace, pdb.Name)
-						returnCh <- pdbErr
-						o.checkAndDeleteWorker(volumeAttachmentEventCh)
-						continue
-					}
-				}
-			} else {
-				pdb := getPdbV1beta1ForPod(o.pdbV1beta1Lister, pod)
-				if pdb != nil {
-					if isMisconfiguredPdbV1beta1(pdb) {
-						pdbErr := fmt.Errorf("error while evicting pod %q: pod disruption budget %s/%s is misconfigured and requires zero voluntary evictions",
-							pod.Name, pdb.Namespace, pdb.Name)
-						returnCh <- pdbErr
-						o.checkAndDeleteWorker(volumeAttachmentEventCh)
-						continue
-					}
+			pdb := getPdbForPod(o.pdbLister, pod)
+			if pdb != nil {
+				if isMisconfiguredPdb(pdb) {
+					pdbErr := fmt.Errorf("error while evicting pod %q: pod disruption budget %s/%s is misconfigured and requires zero voluntary evictions",
+						pod.Name, pdb.Namespace, pdb.Name)
+					returnCh <- pdbErr
+					o.checkAndDeleteWorker(volumeAttachmentEventCh)
+					continue
 				}
 			}
 
@@ -771,8 +753,8 @@ func (o *Options) evictPodsWithPVInternal(
 		)
 
 		podVolumeInfo := podVolumeInfoMap[getPodKey(pod)]
-		ctx, cancelFn := context.WithTimeout(ctx, o.getTerminationGracePeriod(pod)+o.PvDetachTimeout)
-		err = o.waitForDetach(ctx, podVolumeInfo, o.nodeName)
+		volDetachCtx, cancelFn := context.WithTimeout(ctx, o.getTerminationGracePeriod(pod)+o.PvDetachTimeout)
+		err = o.waitForDetach(volDetachCtx, podVolumeInfo, o.nodeName)
 		cancelFn()
 
 		if apierrors.IsNotFound(err) {
@@ -794,8 +776,8 @@ func (o *Options) evictPodsWithPVInternal(
 			time.Since(podEvictionStartTime),
 		)
 
-		ctx, cancelFn = context.WithTimeout(ctx, o.PvReattachTimeout)
-		err = o.waitForReattach(ctx, podVolumeInfo, o.nodeName, volumeAttachmentEventCh)
+		volReattachCtx, cancelFn := context.WithTimeout(ctx, o.PvReattachTimeout)
+		err = o.waitForReattach(volReattachCtx, podVolumeInfo, o.nodeName, volumeAttachmentEventCh)
 		cancelFn()
 
 		if err != nil {
@@ -1059,25 +1041,13 @@ func (o *Options) evictPodWithoutPVInternal(ctx context.Context, attemptEvict bo
 		// Pod couldn't be evicted because of PDB violation
 		klog.V(3).Infof("Pod %s/%s couldn't be evicted from node %s. This may also occur due to PDB violation. Will be retried. Error: %v", pod.Namespace, pod.Name, pod.Spec.NodeName, err)
 
-		if k8sutils.ConstraintK8sGreaterEqual121.Check(o.kubernetesVersion) {
-			pdb := getPdbV1ForPod(o.pdbV1Lister, pod)
-			if pdb != nil {
-				if isMisconfiguredPdbV1(pdb) {
-					pdbErr := fmt.Errorf("error while evicting pod %q: pod disruption budget %s/%s is misconfigured and requires zero voluntary evictions",
-						pod.Name, pdb.Namespace, pdb.Name)
-					returnCh <- pdbErr
-					return
-				}
-			}
-		} else {
-			pdb := getPdbV1beta1ForPod(o.pdbV1beta1Lister, pod)
-			if pdb != nil {
-				if isMisconfiguredPdbV1beta1(pdb) {
-					pdbErr := fmt.Errorf("error while evicting pod %q: pod disruption budget %s/%s is misconfigured and requires zero voluntary evictions",
-						pod.Name, pdb.Namespace, pdb.Name)
-					returnCh <- pdbErr
-					return
-				}
+		pdb := getPdbForPod(o.pdbLister, pod)
+		if pdb != nil {
+			if isMisconfiguredPdb(pdb) {
+				pdbErr := fmt.Errorf("error while evicting pod %q: pod disruption budget %s/%s is misconfigured and requires zero voluntary evictions",
+					pod.Name, pdb.Namespace, pdb.Name)
+				returnCh <- pdbErr
+				return
 			}
 		}
 
@@ -1086,11 +1056,7 @@ func (o *Options) evictPodWithoutPVInternal(ctx context.Context, attemptEvict bo
 
 	if o.ForceDeletePods {
 		// Skip waiting for pod termination in case of forced drain
-		if err == nil {
-			returnCh <- nil
-		} else {
-			returnCh <- err
-		}
+		returnCh <- nil
 		return
 	}
 
@@ -1194,23 +1160,7 @@ func (o *Options) RunCordonOrUncordon(ctx context.Context, desired bool) error {
 	return nil
 }
 
-func getPdbV1ForPod(pdbLister policyv1listers.PodDisruptionBudgetLister, pod *corev1.Pod) *policyv1.PodDisruptionBudget {
-	// GetPodPodDisruptionBudgets returns an error only if no PodDisruptionBudgets are found.
-	// We don't return that as an error to the caller.
-	pdbs, err := pdbLister.GetPodPodDisruptionBudgets(pod)
-	if err != nil {
-		klog.V(4).Infof("No PodDisruptionBudgets found for pod %s/%s.", pod.Namespace, pod.Name)
-		return nil
-	}
-
-	if len(pdbs) > 1 {
-		klog.Warningf("Pod %s/%s matches multiple PodDisruptionBudgets. Chose %q arbitrarily.", pod.Namespace, pod.Name, pdbs[0].Name)
-	}
-
-	return pdbs[0]
-}
-
-func getPdbV1beta1ForPod(pdbLister policyv1beta1listers.PodDisruptionBudgetLister, pod *corev1.Pod) *policyv1beta1.PodDisruptionBudget {
+func getPdbForPod(pdbLister policyv1listers.PodDisruptionBudgetLister, pod *corev1.Pod) *policyv1.PodDisruptionBudget {
 	// GetPodPodDisruptionBudgets returns an error only if no PodDisruptionBudgets are found.
 	// We don't return that as an error to the caller.
 	pdbs, err := pdbLister.GetPodPodDisruptionBudgets(pod)
@@ -1226,15 +1176,7 @@ func getPdbV1beta1ForPod(pdbLister policyv1beta1listers.PodDisruptionBudgetListe
 	return pdbs[0]
 }
 
-func isMisconfiguredPdbV1(pdb *policyv1.PodDisruptionBudget) bool {
-	if pdb.ObjectMeta.Generation != pdb.Status.ObservedGeneration {
-		return false
-	}
-
-	return pdb.Status.ExpectedPods > 0 && pdb.Status.CurrentHealthy >= pdb.Status.ExpectedPods && pdb.Status.DisruptionsAllowed == 0
-}
-
-func isMisconfiguredPdbV1beta1(pdb *policyv1beta1.PodDisruptionBudget) bool {
+func isMisconfiguredPdb(pdb *policyv1.PodDisruptionBudget) bool {
 	if pdb.ObjectMeta.Generation != pdb.Status.ObservedGeneration {
 		return false
 	}
diff --git a/pkg/util/provider/machinecontroller/controller.go b/pkg/util/provider/machinecontroller/controller.go
index b482467d4..97fa3e8db 100644
--- a/pkg/util/provider/machinecontroller/controller.go
+++ b/pkg/util/provider/machinecontroller/controller.go
@@ -31,13 +31,11 @@ import (
 	runtimeutil "k8s.io/apimachinery/pkg/util/runtime"
 	coreinformers "k8s.io/client-go/informers/core/v1"
 	policyv1informers "k8s.io/client-go/informers/policy/v1"
-	policyv1beta1informers "k8s.io/client-go/informers/policy/v1beta1"
 	storageinformers "k8s.io/client-go/informers/storage/v1"
 	"k8s.io/client-go/kubernetes"
 	typedcorev1 "k8s.io/client-go/kubernetes/typed/core/v1"
 	corelisters "k8s.io/client-go/listers/core/v1"
 	policyv1listers "k8s.io/client-go/listers/policy/v1"
-	policyv1beta1listers "k8s.io/client-go/listers/policy/v1beta1"
 	storagelisters "k8s.io/client-go/listers/storage/v1"
 	"k8s.io/client-go/tools/cache"
 	"k8s.io/client-go/tools/record"
@@ -67,8 +65,7 @@ func NewController(
 	pvInformer coreinformers.PersistentVolumeInformer,
 	secretInformer coreinformers.SecretInformer,
 	nodeInformer coreinformers.NodeInformer,
-	pdbV1beta1Informer policyv1beta1informers.PodDisruptionBudgetInformer,
-	pdbV1Informer policyv1informers.PodDisruptionBudgetInformer,
+	pdbInformer policyv1informers.PodDisruptionBudgetInformer,
 	volumeAttachmentInformer storageinformers.VolumeAttachmentInformer,
 	machineClassInformer machineinformers.MachineClassInformer,
 	machineInformer machineinformers.MachineInformer,
@@ -137,13 +134,8 @@ func NewController(
 	controller.nodeSynced = nodeInformer.Informer().HasSynced
 	controller.machineSynced = machineInformer.Informer().HasSynced
 
-	if k8sutils.ConstraintK8sGreaterEqual121.Check(targetKubernetesVersion) {
-		controller.pdbV1Lister = pdbV1Informer.Lister()
-		controller.pdbV1Synced = pdbV1Informer.Informer().HasSynced
-	} else {
-		controller.pdbV1beta1Lister = pdbV1beta1Informer.Lister()
-		controller.pdbV1beta1Synced = pdbV1beta1Informer.Informer().HasSynced
-	}
+	controller.pdbLister = pdbInformer.Lister()
+	controller.pdbSynced = pdbInformer.Informer().HasSynced
 
 	// Secret Controller's Informers
 	_, _ = secretInformer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{
@@ -248,8 +240,7 @@ type controller struct {
 	pvLister                corelisters.PersistentVolumeLister
 	secretLister            corelisters.SecretLister
 	nodeLister              corelisters.NodeLister
-	pdbV1beta1Lister        policyv1beta1listers.PodDisruptionBudgetLister
-	pdbV1Lister             policyv1listers.PodDisruptionBudgetLister
+	pdbLister               policyv1listers.PodDisruptionBudgetLister
 	volumeAttachementLister storagelisters.VolumeAttachmentLister
 	machineClassLister      machinelisters.MachineClassLister
 	machineLister           machinelisters.MachineLister
@@ -264,8 +255,7 @@ type controller struct {
 	pvcSynced               cache.InformerSynced
 	pvSynced                cache.InformerSynced
 	secretSynced            cache.InformerSynced
-	pdbV1beta1Synced        cache.InformerSynced
-	pdbV1Synced             cache.InformerSynced
+	pdbSynced               cache.InformerSynced
 	volumeAttachementSynced cache.InformerSynced
 	nodeSynced              cache.InformerSynced
 	machineClassSynced      cache.InformerSynced
@@ -288,12 +278,12 @@ func (c *controller) Run(workers int, stopCh <-chan struct{}) {
 	defer c.machineSafetyAPIServerQueue.ShutDown()
 
 	if k8sutils.ConstraintK8sGreaterEqual121.Check(c.targetKubernetesVersion) {
-		if !cache.WaitForCacheSync(stopCh, c.secretSynced, c.pvcSynced, c.pvSynced, c.pdbV1Synced, c.volumeAttachementSynced, c.nodeSynced, c.machineClassSynced, c.machineSynced) {
+		if !cache.WaitForCacheSync(stopCh, c.secretSynced, c.pvcSynced, c.pvSynced, c.pdbSynced, c.volumeAttachementSynced, c.nodeSynced, c.machineClassSynced, c.machineSynced) {
 			runtimeutil.HandleError(fmt.Errorf("Timed out waiting for caches to sync"))
 			return
 		}
 	} else {
-		if !cache.WaitForCacheSync(stopCh, c.secretSynced, c.pvcSynced, c.pvSynced, c.pdbV1beta1Synced, c.volumeAttachementSynced, c.nodeSynced, c.machineClassSynced, c.machineSynced) {
+		if !cache.WaitForCacheSync(stopCh, c.secretSynced, c.pvcSynced, c.pvSynced, c.volumeAttachementSynced, c.nodeSynced, c.machineClassSynced, c.machineSynced) {
 			runtimeutil.HandleError(fmt.Errorf("Timed out waiting for caches to sync"))
 			return
 		}
diff --git a/pkg/util/provider/machinecontroller/machine_util.go b/pkg/util/provider/machinecontroller/machine_util.go
index 7f4886051..b0af4dbdd 100644
--- a/pkg/util/provider/machinecontroller/machine_util.go
+++ b/pkg/util/provider/machinecontroller/machine_util.go
@@ -1173,8 +1173,7 @@ func (c *controller) drainNode(ctx context.Context, deleteMachineRequest *driver
 				c.driver,
 				c.pvcLister,
 				c.pvLister,
-				c.pdbV1beta1Lister,
-				c.pdbV1Lister,
+				c.pdbLister,
 				c.nodeLister,
 				c.volumeAttachmentHandler,
 			)


Test patch:
diff --git a/pkg/util/provider/drain/drain_test.go b/pkg/util/provider/drain/drain_test.go
index 0bb450235..a66aba237 100644
--- a/pkg/util/provider/drain/drain_test.go
+++ b/pkg/util/provider/drain/drain_test.go
@@ -157,8 +157,7 @@ var _ = Describe("drain", func() {
 			Out:                          GinkgoWriter,
 			pvcLister:                    fakePVCLister,
 			pvLister:                     fakePVLister,
-			pdbV1beta1Lister:             nil,
-			pdbV1Lister:                  nil,
+			pdbLister:                    nil,
 			nodeLister:                   fakeNodeLister,
 			Timeout:                      2 * time.Minute,
 			volumeAttachmentHandler:      volumeAttachmentHandler,