mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-14 02:43:36 +00:00
e2e: make recreateCSIRBDPods() function to a generic one
This commit make recreateCSIRBDPods function to be a general one so that it can be consumed by more clients. Updates https://github.com/ceph/ceph-csi/issues/2509 Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
This commit is contained in:
committed by
mergify[bot]
parent
8eaf1abbdc
commit
180f0f660f
19
e2e/pod.go
19
e2e/pod.go
@ -395,3 +395,22 @@ func getKernelVersionFromDaemonset(f *framework.Framework, ns, dsn, cn string) (
|
||||
|
||||
return kernelRelease, nil
|
||||
}
|
||||
|
||||
// recreateCSIPods delete the daemonset and deployment pods based on the selectors passed in.
|
||||
func recreateCSIPods(f *framework.Framework, podLabels, daemonsetName, deploymentName string) error {
|
||||
err := deletePodWithLabel(podLabels, cephCSINamespace, false)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to delete pods with labels (%s): %w", podLabels, err)
|
||||
}
|
||||
// wait for csi pods to come up
|
||||
err = waitForDaemonSets(daemonsetName, cephCSINamespace, f.ClientSet, deployTimeout)
|
||||
if err != nil {
|
||||
return fmt.Errorf("timeout waiting for daemonset pods: %w", err)
|
||||
}
|
||||
err = waitForDeploymentComplete(f.ClientSet, deploymentName, cephCSINamespace, deployTimeout)
|
||||
if err != nil {
|
||||
return fmt.Errorf("timeout waiting for deployment to be in running state: %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user