Skip to content

Commit

Permalink
Updated odf subscription code for hcp clusters and added storage_quot…
Browse files Browse the repository at this point in the history
…a parameter in create_hypershift_clusters fixture

Signed-off-by: Amrita Mahapatra <[email protected]>
  • Loading branch information
amr1ta committed Dec 4, 2024
1 parent 8a0394c commit be873fe
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions ocs_ci/deployment/hosted_cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -1147,6 +1147,8 @@ def create_subscription(self):
)
if "latest" in hosted_odf_version:
hosted_odf_version = hosted_odf_version.split("-")[-1]
elif len(hosted_odf_version) > 4:
hosted_odf_version = hosted_odf_version[:4]

subscription_data["spec"]["channel"] = f"stable-{str(hosted_odf_version)}"

Expand Down
7 changes: 6 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -8420,10 +8420,14 @@ def factory(
odf_version (str): ODF version
setup_storage_client (bool): Setup storage client
nodepool_replicas (int): Nodepool replicas; supported values are 2,3
storage_quota (int): storage quota, default value unlimited
"""
hosted_cluster_conf_on_provider = {"ENV_DATA": {"clusters": {}}}

storage_quota = None
if odf_version >= version.VERSION_4_17:
storage_quota = ocsci_config.ENV_DATA.clusters.get("storage_quota")
logging.info(f"storage quota allocated: {storage_quota}")
for cluster_name in cluster_names:
hosted_cluster_conf_on_provider["ENV_DATA"]["clusters"][cluster_name] = {
"hosted_cluster_path": f"~/clusters/{cluster_name}/openshift-cluster-dir",
Expand All @@ -8434,6 +8438,7 @@ def factory(
"hosted_odf_version": odf_version,
"setup_storage_client": setup_storage_client,
"nodepool_replicas": nodepool_replicas,
"storage_quota": storage_quota,
}

log.info(
Expand Down

0 comments on commit be873fe

Please sign in to comment.