diff --git a/ocs_ci/deployment/deployment.py b/ocs_ci/deployment/deployment.py index 1e5bf506d7e..f1e1c198f35 100644 --- a/ocs_ci/deployment/deployment.py +++ b/ocs_ci/deployment/deployment.py @@ -163,7 +163,7 @@ from ocs_ci.helpers.helpers import ( set_configmap_log_level_rook_ceph_operator, get_default_storage_class, - update_volsync_channel, + update_volsync_icsp, ) from ocs_ci.ocs.ui.helpers_ui import ui_deployment_conditions from ocs_ci.utility.utils import get_az_count @@ -3667,7 +3667,7 @@ def deploy(self): rbddops.deploy() self.enable_acm_observability() self.deploy_dr_policy() - update_volsync_channel() + update_volsync_icsp() # Enable cluster backup on both ACMs for i in acm_indexes: @@ -3847,7 +3847,7 @@ def deploy(self): self.configure_mirror_peer() # Deploy dr policy self.deploy_dr_policy() - update_volsync_channel() + update_volsync_icsp() # Configure DRClusters for fencing automation configure_drcluster_for_fencing() diff --git a/ocs_ci/helpers/helpers.py b/ocs_ci/helpers/helpers.py index c03f840c408..d836d0b1818 100644 --- a/ocs_ci/helpers/helpers.py +++ b/ocs_ci/helpers/helpers.py @@ -61,6 +61,7 @@ update_container_with_mirrored_image, exec_cmd, get_ocs_build_number, + wait_for_machineconfigpool_status, ) from ocs_ci.utility.utils import convert_device_size @@ -5433,6 +5434,42 @@ def update_volsync_channel(): ) +def update_volsync_icsp(): + """ + Update Volsync ImageContentSourcePolicy. + + """ + logger.info("Creating ImageContentSourcePolicy for Volsync") + restore_index = config.cur_index + non_acm_clusters = get_non_acm_cluster_config() + from ocs_ci.ocs.resources.pod import delete_pods, get_all_pods + + for non_acm_cluster in non_acm_clusters: + index = non_acm_cluster.MULTICLUSTER["multicluster_index"] + config.switch_ctx(index) + run_cmd(f"oc apply -f {constants.ACM_BREW_ICSP_YAML}") + wait_for_machineconfigpool_status("all", timeout=1800) + volsync_pod_list = get_all_pods( + namespace=constants.VOLSYNC_NAMESPACE, + selector_label="app.kubernetes.io/name=volsync", + ) + delete_pods(volsync_pod_list, wait=True) + logger.info("Verify volsync pods in Running state") + sample = TimeoutSampler( + timeout=300, + sleep=10, + func=check_pods_status_by_pattern, + pattern="volsync", + namespace=constants.VOLSYNC_NAMESPACE, + expected_status=constants.STATUS_RUNNING, + ) + if not sample.wait_for_func_status(result=True): + logger.error( + f"Pod volsync not in {constants.STATUS_RUNNING} after 300 seconds" + ) + config.switch_ctx(restore_index) + + def verify_nb_db_psql_version(check_image_name_version=True): """ Verify that the NooBaa DB PostgreSQL version matches the expectation diff --git a/ocs_ci/ocs/constants.py b/ocs_ci/ocs/constants.py index 52c92254b10..cb66a10ad34 100644 --- a/ocs_ci/ocs/constants.py +++ b/ocs_ci/ocs/constants.py @@ -1258,7 +1258,7 @@ RDR_OSD_MODE_GREENFIELD = "greenfield" RDR_OSD_MODE_BROWNFIELD = "brownfield" RDR_VOLSYNC_CEPHFILESYSTEM_SC = "ocs-storagecluster-cephfs-vrg" - +VOLSYNC_NAMESPACE = "volsync-system" # constants RBD_INTERFACE = "rbd"