Skip to content

Optmize handling topology logic#519

Merged
openshift-merge-bot[bot] merged 1 commit intoopenstack-k8s-operators:mainfrom
fmount:topology_optimize
Apr 15, 2025
Merged

Optmize handling topology logic#519
openshift-merge-bot[bot] merged 1 commit intoopenstack-k8s-operators:mainfrom
fmount:topology_optimize

Conversation

@fmount
Copy link
Contributor

@fmount fmount commented Apr 15, 2025

This patch removes the need of using GetLastAppliedTopologyRef to build a topologyRef used by EnsureServiceTopology provided by infra-operator. In particular, we can now blindly pass instance.Status.LastAppliedTopologyRef, and checking that is not nil is deferred to the infra-operator logic [1]. This change also allows to deduplicate most of the common code present in all operators.
As part of the same change, envTests are improved and both CreateTopology and GetTopology function calls now rely on infra-operator's implementation.

Depends-On: openstack-k8s-operators/infra-operator#367
Jira: https://issues.redhat.com/browse/OSPRH-15412

[1] openstack-k8s-operators/infra-operator#367

This patch removes the need of using GetLastAppliedTopologyRef to build
a topologyRef used by EnsureServiceTopology provided by infra-operator.
In particular, we can now blindly pass instance.Status.lastAppliedTopologyRef,
and checking that is not nil is deferred to the infra-operator logic [1].
This change also allows to deduplicate most of the common code present
in all operators.

[1] openstack-k8s-operators/infra-operator#367

Signed-off-by: Francesco Pantano <fpantano@redhat.com>
@fmount fmount requested a review from stuggi April 15, 2025 07:55
@openshift-ci openshift-ci bot requested review from dprince and rabi April 15, 2025 07:55
@fmount fmount requested a review from bshephar April 15, 2025 07:55
Copy link
Contributor

@stuggi stuggi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Apr 15, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: fmount, stuggi

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-bot openshift-merge-bot bot merged commit 8324ba0 into openstack-k8s-operators:main Apr 15, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants