[OSPRH-21185] Install OLS operator#27
Conversation
86dc3ce to
ee1e2b8
Compare
f9dbd37 to
8b47be5
Compare
Implement automatic installation, version checking ,and lifecycle management of the OpenShift Lightspeed operator. Add support for both user-installed and instance-owned installation modes with proper ownership tracking. If the OLS operator has already been installed then the OpenStack Lightspeed operator checks it version. If the version is valied OpenStack Lightspeed utilizes the preinstalled OLS operator. If the OLS operator has not been already installed then the operator installs it. In this mode when the OpenStackLightspeed instance is created the OLS operator is automatically uninstalled as well. Whereas in the preinstalled OLS operator mode the OLS oeprator stays even after the removal of the OpenStackLightspeed instance.
Introduce a ping function that adds a random label to OLSConfig resources to trigger reconciliation by the OpenShift Lightspeed operator. This ensures the operator updates the Status field when the OLSConfig is not ready. This addresses a current limitation where the OLS operator does not automatically update the OLSConfig status when installed in the openstack-lightspeed namespace.
Because the OpenStack Lightspeed operator now depends on the OPENSHIFT_LIGTSPEED_OPERATOR_VERSION variable we have to ensure that it is set when we run the operator during development with make run.
8b47be5 to
4405e51
Compare
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: lpiwowar The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Update README to remove manual OLS operator deployment step since the operator now handles this automatically. This commit also renames the catalog-deploy to openstack-lightspeed-deploy to better reflect its behavior.
Update go.mod and go.sum with latest dependency versions.
Split RBAC permissions into cluster-scoped (read-only CSV list/watch) and namespace-scoped (CSV/subscription/installplan management) roles to support namespace-scoped operator deployment. Note that this commit adjusts the permissions that are related to the recent changes (OLS operator installation). In the follow up changes we have to modify the permissions for other resources as well.
Configure the operator to watch only the namespace specified in the WATCH_NAMESPACE environment variable instead of watching all namespaces cluster-wide. This enables namespace-scoped RBAC permissions for the operator. GetOLSOperatorCSV now uses a raw client to query CSVs cluster-wide, since the default controller client is scoped to WATCH_NAMESPACE.
4405e51 to
adba0a0
Compare
|
/hold We have to first figure out how we want to depend on the OLS Operator. If we decide that we still want to use the OLS operator to deploy OpenStack Lightspeed than we have to ensure that OLS team does not delete old versions of their operator from the OperatorHub. |
umago
left a comment
There was a problem hiding this comment.
Code LGTM in general, left two ideas inline. Let me know what u think
|
@umago: I made the changes you wanted me to do. Let me know what you think:). For now, I kept the workaround in the PR [1]. The thing is that the [1] https://github.com/openstack-lightspeed/operator/pull/27/files |
|
/unhold I'm removing the hold label because we agreed that:
|
umago
left a comment
There was a problem hiding this comment.
Few nits, other than that LGTM!
Default OPENSHIFT_LIGHTSPEED_OPERATOR_VERSION to "latest" to ensure compatibility with Operator Hub, which does not retain older versions indefinitely. Changes: - Set default version to "latest" in manager.yaml - Update GetRecommendedOLSVersion to handle "latest" value - Add SetStartingCSV helper to set version conditionally in Subscriptions - Return error when user-installed OLS operator is detected instead of attempting version compatibility check Future work should consider pinning to specific versions for production stability.
Install the OpenStack Lightspeed operator into the openshift-lightspeed namespace by default to align with ownership responsibilities and ensure compatibility, as the OLS operator is not guaranteed to function correctly in other namespaces.
b1bc750 to
1c63181
Compare
|
/lgtm |
0e1d583
into
openstack-lightspeed:main
Implement automatic installation, version checking, and lifecycle management of the OpenShift Lightspeed operator. Add support for both user-installed and instance-owned installation modes, with proper ownership tracking.
If the OLS operator has already been installed, then the OpenStack lightspeed operator checks it version. If the version is valid OpenStack Lightspeed utilizes the preinstalled OLS operator.
If the OLS operator has not been already installed, then the operator installs it. In this mode, when the OpenStackLightspeed instance is created, the OLS operator is automatically uninstalled as well. Whereas in the preinstalled OLS operator mode, the OLS operator stays even after the removal of the OpenStackLightspeed instance.