Skip to content

Commit

Permalink
fix code
Browse files Browse the repository at this point in the history
Signed-off-by: oviner <[email protected]>
  • Loading branch information
OdedViner committed Jul 24, 2024
1 parent 2e67781 commit 0136367
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
10 changes: 10 additions & 0 deletions ocs_ci/ocs/resources/ocs.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,16 @@ def __setstate__(self, d):


def get_version_info(namespace=None):
"""
Get OCS versions and DR operator versions
Args:
namespace (str): the CSVs namespace
Returns:
dict: the ocs versions and DR operator versions
"""
operator_selector = get_selector_for_ocs_operator()
subscription_plan_approval = config.DEPLOYMENT.get("subscription_plan_approval")
package_manifest = PackageManifest(
Expand Down
5 changes: 1 addition & 4 deletions ocs_ci/ocs/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1735,16 +1735,13 @@ def get_dr_operator_versions():
versions_dic[
"odf_multicluster_orchestrator_version"
] = odf_multicluster_orchestrator_version
gitops_operator_version = get_ocp_gitops_operator_version()
if gitops_operator_version:
versions_dic["gitops_version"] = gitops_operator_version
with ocsci_config.RunWithPrimaryConfigContext():
oadp_operator_version = get_oadp_version()
if oadp_operator_version:
versions_dic["oadp_version"] = oadp_operator_version
ocp_dr_cluster_operator_version = get_ocp_dr_cluster_operator_version()
if ocp_dr_cluster_operator_version:
versions_dic["ocp_dr_cluster_version"] = ocp_dr_cluster_operator_version
versions_dic["dr_cluster_version"] = ocp_dr_cluster_operator_version
gitops_operator_version = get_ocp_gitops_operator_version()
if gitops_operator_version:
versions_dic["gitops_version"] = gitops_operator_version
Expand Down
2 changes: 1 addition & 1 deletion ocs_ci/utility/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ def get_ocp_gitops_operator_version(namespace=constants.OPENSHIFT_NAMESPACE):
"openshift-gitops-operator", namespace=namespace
)
for csv in csv_list:
if "openshift-gitops-operator" in csv["metadata"]["name"]:
if constants.GITOPS_OPERATOR_NAME in csv["metadata"]["name"]:
# extract version string
return csv["spec"]["version"]

Expand Down

0 comments on commit 0136367

Please sign in to comment.