Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename restic pods selector to 'node-agent' #8561

Merged
merged 6 commits into from
Oct 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions ocs_ci/deployment/deployment.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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")
Expand Down
17 changes: 17 additions & 0 deletions ocs_ci/utility/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Loading