From a7ae7c4f5d0bb324883a03c1cb6095adc14bfe00 Mon Sep 17 00:00:00 2001 From: prsurve Date: Thu, 6 Jun 2024 12:09:56 +0530 Subject: [PATCH] Fix OADP and Gitops Operator install Signed-off-by: prsurve --- ocs_ci/deployment/deployment.py | 29 ++++--------------- .../gitops-deployment/subscription.yaml | 1 - .../oadp-deployment/subscription.yaml | 1 - 3 files changed, 6 insertions(+), 25 deletions(-) diff --git a/ocs_ci/deployment/deployment.py b/ocs_ci/deployment/deployment.py index 7d61bfcf6c40..98bfe019ace6 100644 --- a/ocs_ci/deployment/deployment.py +++ b/ocs_ci/deployment/deployment.py @@ -238,31 +238,14 @@ 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) + logger.info("Sleeping for 120 seconds after subscribing to GitOps Operator") + time.sleep(120) subscriptions = ocp.OCP( kind=constants.SUBSCRIPTION_WITH_ACM, resource_name=constants.GITOPS_OPERATOR_NAME, @@ -468,15 +451,15 @@ def do_deploy_oadp(self): constants.OADP_OPERATOR_NAME, namespace=constants.OADP_NAMESPACE ) logger.info( - "Sleeping for 90 seconds after subscribing to OADP Operator" + "Sleeping for 120 seconds after subscribing to OADP Operator" ) - time.sleep(90) + time.sleep(120) 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 7c638f41d564..db8f0e9c96be 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 c29f64ee939a..5300bf7260d6 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