Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename private reconcile method to reconcileKafkaRebalance #10438

Merged
merged 2 commits into from
Aug 13, 2024

Conversation

steffen-karlsson
Copy link
Contributor

@steffen-karlsson steffen-karlsson commented Aug 12, 2024

Type of change

Select the type of your PR

  • Refactoring

Description

Fixing issue #10420
Renaming for less confusion as AbstractOperator as well exposes a reconcile method.

Checklist

Please go through this checklist and make sure all applicable tasks have been done

  • Write tests
  • Make sure all tests pass
  • Update documentation
  • Check RBAC rights for Kubernetes / OpenShift roles
  • Try your changes from Pod inside your Kubernetes and OpenShift cluster, not just locally
  • Reference relevant issue(s) and close them after merging
  • Update CHANGELOG.md
  • Supply screenshots for visual changes, such as Grafana dashboards

@scholzj scholzj requested a review from ppatierno August 12, 2024 08:02
@scholzj scholzj added this to the 0.43.0 milestone Aug 12, 2024
@scholzj scholzj linked an issue Aug 12, 2024 that may be closed by this pull request
Signed-off-by: Steffen Karlsson <steffen.karlsson@maersk.com>
Copy link
Member

@scholzj scholzj left a comment

Choose a reason for hiding this comment

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

LGTM. Thansk for the PR.

@scholzj
Copy link
Member

scholzj commented Aug 12, 2024

/azp run regression

@ppatierno
Copy link
Member

ppatierno commented Aug 13, 2024

@steffen-karlsson thanks for the PR, while I know that the current naming is misleading and bad as pointed out by Jakub, I am not convinced the proposed name is the best one. Right now the calls chain is made by ... (where KRAO is our KafkaRebalanceAssemblyOperator)

AbstractOperator.reconcile() --> KRAO.createOrUpdate() --> reconcileRebalance(Reconciliation, KafkaRebalance) --> reconcile(Reconciliation, Host, CC API client, KafkaRebalance, KafkaRebalanceStatus)

We are trying to rename the last reconcile and the current proposal is reconcileKafkaRebalance which could make sense if there wasn't the existing reconcileRebalance that could be renamed the same way.
My opinion is that the current reconcileRebalance could be renamed as reconcileKafkaRebalance (because it's the first entry point from the overall reconcile, and its goal is to actually reconciling the KafkaRebalance custom resource).
Now coming back to the reconcile, this is the method which is going to interact with CC (through the FSM) to get optimization proposals, running the rebalancing (by calling requestRebalance in both cases), verifying its status and returning back an updated one. So what do you think about something like processRebalancing, processRebalance, handleRebalance but not mentioning reconcile at all?

@scholzj @katheris because you already approved, wdyt about my reasoning for changing the proposal?

@scholzj
Copy link
Member

scholzj commented Aug 13, 2024

@scholzj @katheris because you already approved, wdyt about my reasoning for changing the proposal?

I do not have a problem with it being changed as you suggested.

@katheris
Copy link
Contributor

@scholzj @katheris because you already approved, wdyt about my reasoning for changing the proposal?

The reasoning makes sense to me, I think handleRebalance works best of the ones you suggested. Might also be useful to add some javadoc to that method, but that can be done in a separate PR.

@ppatierno
Copy link
Member

Cool! Thanks folds ... so @steffen-karlsson if you agree I would go this way ...

reconcileRebalance renamed into reconcileKafkaRebalance
reconcile renamed into handleRebalance

Wdyt?

Signed-off-by: Steffen Karlsson <steffen.karlsson@maersk.com>
Copy link
Contributor

@katheris katheris left a comment

Choose a reason for hiding this comment

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

LGTM

@ppatierno
Copy link
Member

/azp run regression

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Member

@ppatierno ppatierno left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks!

@ppatierno ppatierno merged commit a0bd37b into strimzi:main Aug 13, 2024
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rename KafkaRebalanceAssemblyOperator's reconcile(...) method
4 participants