diff --git a/ocs_ci/deployment/deployment.py b/ocs_ci/deployment/deployment.py index 192939b51fb..9c4943b7c27 100644 --- a/ocs_ci/deployment/deployment.py +++ b/ocs_ci/deployment/deployment.py @@ -130,6 +130,7 @@ load_auth_config, TimeoutSampler, get_latest_acm_tag_unreleased, + get_oadp_version, ) from ocs_ci.utility.vsphere_nodes import update_ntp_compute_nodes from ocs_ci.helpers import helpers @@ -2832,9 +2833,16 @@ def validate_dpa(self): 3. backupstoragelocation resource in "Available" phase """ - # Check restic pods + # Check restic pods. + # Restic pods have been renamed to node-agent after oadp 1.2 + oadp_version = get_oadp_version() + + if version.compare_versions(f"{oadp_version} >= 1.2"): + restic_pod_prefix = "node-agent" + else: + restic_pod_prefix = "restic" restic_list = get_pods_having_label( - "name=restic", constants.ACM_HUB_BACKUP_NAMESPACE + f"name={restic_pod_prefix}", constants.ACM_HUB_BACKUP_NAMESPACE ) if len(restic_list) != constants.MDR_RESTIC_POD_COUNT: raise MDRDeploymentException("restic pod count mismatch") diff --git a/ocs_ci/utility/utils.py b/ocs_ci/utility/utils.py index 5570651f662..02c72a3d1e8 100644 --- a/ocs_ci/utility/utils.py +++ b/ocs_ci/utility/utils.py @@ -4507,3 +4507,20 @@ def add_time_report_to_email(session, soup): table = BeautifulSoup(table_html, "html.parser") time_div.append(table) summary_tag.insert_after(time_div) + + +def get_oadp_version(): + """ + Returns: + str: returns version string + """ + # Importing here to avoid circular dependency + from ocs_ci.ocs.resources.csv import get_csvs_start_with_prefix + + csv_list = get_csvs_start_with_prefix( + "oadp-operator", namespace=constants.ACM_HUB_BACKUP_NAMESPACE + ) + for csv in csv_list: + if "oadp-operator" in csv["metadata"]["name"]: + # extract version string + return csv["spec"]["version"]