From ad2d18130d3222843ca1f2eb408956dc3d60dee9 Mon Sep 17 00:00:00 2001 From: Pratik Surve Date: Fri, 19 Jul 2024 21:57:01 +0530 Subject: [PATCH] Fix OADP and Gitops Operator install (#9905) * Fix OADP and Gitops Operator install * Fix OADP and Gitops Operator install * Remove sleep --------- Signed-off-by: prsurve --- ocs_ci/deployment/deployment.py | 33 ++----------------- .../gitops-deployment/subscription.yaml | 1 - .../oadp-deployment/subscription.yaml | 1 - 3 files changed, 2 insertions(+), 33 deletions(-) diff --git a/ocs_ci/deployment/deployment.py b/ocs_ci/deployment/deployment.py index cefe194d5ba..b31c4405d32 100644 --- a/ocs_ci/deployment/deployment.py +++ b/ocs_ci/deployment/deployment.py @@ -244,31 +244,12 @@ def deploy_gitops_operator(self, switch_ctx=None): config.switch_ctx(switch_ctx) if switch_ctx else config.switch_acm_ctx() logger.info("Creating GitOps Operator Subscription") - gitops_subscription_yaml_data = templating.load_yaml( - constants.GITOPS_SUBSCRIPTION_YAML - ) - package_manifest = PackageManifest( - resource_name=constants.GITOPS_OPERATOR_NAME, - ) - gitops_subscription_yaml_data["spec"][ - "startingCSV" - ] = package_manifest.get_current_csv( - channel="latest", csv_pattern=constants.GITOPS_OPERATOR_NAME - ) - gitops_subscription_manifest = tempfile.NamedTemporaryFile( - mode="w+", prefix="gitops_subscription_manifest", delete=False - ) - templating.dump_data_to_temp_yaml( - gitops_subscription_yaml_data, gitops_subscription_manifest.name - ) - run_cmd(f"oc create -f {gitops_subscription_manifest.name}") + run_cmd(f"oc create -f {constants.GITOPS_SUBSCRIPTION_YAML}") self.wait_for_subscription( constants.GITOPS_OPERATOR_NAME, namespace=constants.OPENSHIFT_OPERATORS ) - logger.info("Sleeping for 90 seconds after subscribing to GitOps Operator") - time.sleep(90) subscriptions = ocp.OCP( kind=constants.SUBSCRIPTION_WITH_ACM, resource_name=constants.GITOPS_OPERATOR_NAME, @@ -461,12 +442,6 @@ def do_deploy_oadp(self): resource_name=constants.OADP_OPERATOR_NAME, ) oadp_default_channel = package_manifest.get_default_channel() - oadp_subscription_yaml_data["spec"][ - "startingCSV" - ] = package_manifest.get_current_csv( - channel=oadp_default_channel, - csv_pattern=constants.OADP_OPERATOR_NAME, - ) oadp_subscription_yaml_data["spec"]["channel"] = oadp_default_channel oadp_subscription_manifest = tempfile.NamedTemporaryFile( mode="w+", prefix="oadp_subscription_manifest", delete=False @@ -478,16 +453,12 @@ def do_deploy_oadp(self): self.wait_for_subscription( constants.OADP_OPERATOR_NAME, namespace=constants.OADP_NAMESPACE ) - logger.info( - "Sleeping for 90 seconds after subscribing to OADP Operator" - ) - time.sleep(90) oadp_subscriptions = ocp.OCP( kind=constants.SUBSCRIPTION_WITH_ACM, resource_name=constants.OADP_OPERATOR_NAME, namespace=constants.OADP_NAMESPACE, ).get() - oadp_csv_name = oadp_subscriptions["spec"]["startingCSV"] + oadp_csv_name = oadp_subscriptions["status"]["currentCSV"] csv = CSV( resource_name=oadp_csv_name, namespace=constants.OADP_NAMESPACE ) diff --git a/ocs_ci/templates/gitops-deployment/subscription.yaml b/ocs_ci/templates/gitops-deployment/subscription.yaml index 7c638f41d56..db8f0e9c96b 100644 --- a/ocs_ci/templates/gitops-deployment/subscription.yaml +++ b/ocs_ci/templates/gitops-deployment/subscription.yaml @@ -9,4 +9,3 @@ spec: name: openshift-gitops-operator source: redhat-operators sourceNamespace: openshift-marketplace - startingCSV: PLACEHOLDER diff --git a/ocs_ci/templates/oadp-deployment/subscription.yaml b/ocs_ci/templates/oadp-deployment/subscription.yaml index c29f64ee939..5300bf7260d 100644 --- a/ocs_ci/templates/oadp-deployment/subscription.yaml +++ b/ocs_ci/templates/oadp-deployment/subscription.yaml @@ -9,4 +9,3 @@ spec: name: redhat-oadp-operator source: redhat-operators sourceNamespace: openshift-marketplace - startingCSV: PLACEHOLDER