Skip to content

Commit

Permalink
Updated odf installation on provider using ocs-catalogsource
Browse files Browse the repository at this point in the history
Signed-off-by: Amrita Mahapatra <[email protected]>
  • Loading branch information
amr1ta committed Dec 12, 2024
1 parent 7205d27 commit 01face2
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
7 changes: 5 additions & 2 deletions ocs_ci/deployment/hosted_cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,9 @@ def deploy_multiple_odf_clients(self):
hosted_odf.do_deploy()


class HypershiftHostedOCP(HyperShiftBase, MetalLBInstaller, CNVInstaller, Deployment):
class HypershiftHostedOCP(
HyperShiftBase, MetalLBInstaller, CNVInstaller, Deployment, MCEInstaller
):
def __init__(self, name):
Deployment.__init__(self)
HyperShiftBase.__init__(self)
Expand Down Expand Up @@ -388,6 +390,7 @@ def deploy_ocp(
deploy_acm_hub=True,
deploy_metallb=True,
download_hcp_binary=True,
deploy_mce=True,
):
"""
Deploy hosted OCP cluster on provisioned Provider platform
Expand All @@ -408,7 +411,7 @@ def deploy_ocp(
deploy_acm_hub = False

self.deploy_dependencies(
deploy_acm_hub, deploy_cnv, deploy_metallb, download_hcp_binary
deploy_acm_hub, deploy_cnv, deploy_metallb, download_hcp_binary, deploy_mce
)

ocp_version = str(config.ENV_DATA["clusters"][self.name].get("ocp_version"))
Expand Down
18 changes: 18 additions & 0 deletions ocs_ci/deployment/provider_client/storage_client_deployment.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import logging
import time
import tempfile


from ocs_ci.framework import config
Expand Down Expand Up @@ -41,6 +42,7 @@
verify_block_pool_exists,
)
from ocs_ci.ocs.exceptions import CommandFailed
from ocs_ci.ocs.resources.catalog_source import CatalogSource


log = logging.getLogger(__name__)
Expand Down Expand Up @@ -322,6 +324,22 @@ def odf_subscription_on_provider(self):
live_deployment = config.DEPLOYMENT.get("live_deployment")
if not live_deployment:
create_catalog_source()
catalog_data = templating.load_yaml(constants.PROVIDER_MODE_CATALOGSOURCE)
catalog_data["spec"]["image"] = config.DEPLOYMENT.get(
"ocs_registry_image", ""
)
catalog_data_yaml = tempfile.NamedTemporaryFile(
mode="w+", prefix="catalog_data", delete=False
)
templating.dump_data_to_temp_yaml(catalog_data, catalog_data_yaml.name)
self.ocp_obj.exec_oc_cmd(f"apply -f {catalog_data_yaml.name}")

catalog_source = CatalogSource(
resource_name=constants.OCS_CATALOG_SOURCE_NAME,
namespace=constants.MARKETPLACE_NAMESPACE,
)
# Wait for catalog source is ready
catalog_source.wait_for_state("READY")

log.info("Creating namespace and operator group.")
olm_data = templating.load_yaml(constants.OLM_YAML, multi_document=True)
Expand Down

0 comments on commit 01face2

Please sign in to comment.