Skip to content

Commit

Permalink
Fix OADP and Gitops Operator install (red-hat-storage#9905)
Browse files Browse the repository at this point in the history
* Fix OADP and Gitops Operator install

* Fix OADP and Gitops Operator install

* Remove sleep

---------

Signed-off-by: prsurve <[email protected]>
  • Loading branch information
prsurve authored and Amrita Mahapatra committed Jul 25, 2024
1 parent 7442390 commit ad2d181
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 33 deletions.
33 changes: 2 additions & 31 deletions ocs_ci/deployment/deployment.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand All @@ -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
)
Expand Down
1 change: 0 additions & 1 deletion ocs_ci/templates/gitops-deployment/subscription.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,3 @@ spec:
name: openshift-gitops-operator
source: redhat-operators
sourceNamespace: openshift-marketplace
startingCSV: PLACEHOLDER
1 change: 0 additions & 1 deletion ocs_ci/templates/oadp-deployment/subscription.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,3 @@ spec:
name: redhat-oadp-operator
source: redhat-operators
sourceNamespace: openshift-marketplace
startingCSV: PLACEHOLDER

0 comments on commit ad2d181

Please sign in to comment.