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

Refactoring KafkaRebalance state extraction #10445

Merged

Conversation

ppatierno
Copy link
Member

Type of change

  • Refactoring

Description

This PR does a little bit of refactoring around how the "state" of a rebalancing is extracted from the KafkaRebalance status, avoiding using String for comparison and too many methods.
Doing that, it provides a new KafkaRebalanceUtils class where the main related methods are moved. This class could host more in a future refactoring.
Also, it provides a way to access the rebalancing state for a KafkaRebalance even in relation to the auto-rebalancing work.

Checklist

  • Make sure all tests pass
  • Try your changes from Pod inside your Kubernetes and OpenShift cluster, not just locally

Signed-off-by: Paolo Patierno <ppatierno@live.com>
@ppatierno ppatierno added this to the 0.43.0 milestone Aug 14, 2024
@ppatierno ppatierno requested review from scholzj and a team August 14, 2024 10:07
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. Should there be some unit tests for KafkaRebalanceUtils?

@ppatierno
Copy link
Member Author

LGTM. Should there be some unit tests for KafkaRebalanceUtils?

yeah will do. Starting regression tests meanwhile :-)

@ppatierno
Copy link
Member Author

/azp run regression

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Signed-off-by: Paolo Patierno <ppatierno@live.com>
Signed-off-by: Paolo Patierno <ppatierno@live.com>
@ppatierno
Copy link
Member Author

The regression I started before adding unit testing is finally green.

https://dev.azure.com/cncf/strimzi/_build/results?buildId=177859&view=results

I think we can merge this one.

@ppatierno ppatierno merged commit dacdc85 into strimzi:main Aug 15, 2024
13 checks passed
@ppatierno ppatierno deleted the refactoring-rebalance-state-extraction branch August 15, 2024 06:34
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.

2 participants