diff --git a/ocs_ci/deployment/hosted_cluster.py b/ocs_ci/deployment/hosted_cluster.py index ea2f44429af..af37a4227d6 100644 --- a/ocs_ci/deployment/hosted_cluster.py +++ b/ocs_ci/deployment/hosted_cluster.py @@ -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) @@ -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 @@ -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")) diff --git a/ocs_ci/deployment/provider_client/storage_client_deployment.py b/ocs_ci/deployment/provider_client/storage_client_deployment.py index 2af97a2205d..4153e7ca8bf 100644 --- a/ocs_ci/deployment/provider_client/storage_client_deployment.py +++ b/ocs_ci/deployment/provider_client/storage_client_deployment.py @@ -4,6 +4,7 @@ import logging import time +import tempfile from ocs_ci.framework import config @@ -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__) @@ -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)