Skip to content

Commit

Permalink
RDR - Skip PVC and PV deletion check for CephFS (red-hat-storage#9073)
Browse files Browse the repository at this point in the history

Signed-off-by: Jilju Joy <[email protected]>
  • Loading branch information
jilju authored Dec 21, 2023
1 parent a8d2306 commit 8fda5cb
Showing 1 changed file with 16 additions and 21 deletions.
37 changes: 16 additions & 21 deletions ocs_ci/helpers/dr_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -664,33 +664,28 @@ def wait_for_all_resources_deletion(
namespace, timeout, check_replication_resources_state
)

logger.info("Waiting for all PVCs to be deleted")
all_pvcs = get_all_pvc_objs(namespace=namespace)
if not (
config.MULTICLUSTER["multicluster_mode"] == "regional-dr"
and "cephfs" in namespace
):
logger.info("Waiting for all PVCs to be deleted")
all_pvcs = get_all_pvc_objs(namespace=namespace)

for pvc_obj in all_pvcs:
if "volsync-" not in pvc_obj.name:
for pvc_obj in all_pvcs:
pvc_obj.ocp.wait_for_delete(
resource_name=pvc_obj.name, timeout=timeout, sleep=5
)

if config.MULTICLUSTER["multicluster_mode"] != "metro-dr":
logger.info("Waiting for all PVs to be deleted")
# Check whether volsync PVCs are still present. The value from the previous step is not obtained because the
# PVCs might be in deleting state and the count may change.
num_of_volsync_pvc = len(
[
pvc_obj.name
for pvc_obj in get_all_pvc_objs(namespace=namespace)
if "volsync-" in pvc_obj.name
]
)
sample = TimeoutSampler(
timeout=timeout,
sleep=5,
func=get_pv_count,
namespace=namespace,
)
sample.wait_for_func_value(num_of_volsync_pvc)
if "cephfs" not in namespace:
logger.info("Waiting for all PVs to be deleted")
sample = TimeoutSampler(
timeout=timeout,
sleep=5,
func=get_pv_count,
namespace=namespace,
)
sample.wait_for_func_value(0)


def wait_for_replication_destinations_creation(rep_dest_count, namespace, timeout=900):
Expand Down

0 comments on commit 8fda5cb

Please sign in to comment.