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

Improve the role change reversal and properly revert them #10098

Merged
merged 1 commit into from
May 13, 2024

Conversation

scholzj
Copy link
Member

@scholzj scholzj commented May 12, 2024

Type of change

  • Bugfix

Description

The current way how the reversal of the role change when a broker role is removed from a node that is not empty is implemented as simply adding the broker role back. But that is not the reversal in case the role is changed from broker to controller. That leads the operator into a strange in the middle state where the controller role is applied but the broker role is not removed. This PR fixes it by reverting the roles to the original state before this change and maintaining the current state.

Checklist

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

@scholzj scholzj added this to the 0.42.0 milestone May 12, 2024
@scholzj scholzj requested a review from ppatierno May 12, 2024 00:23
@scholzj
Copy link
Member Author

scholzj commented May 12, 2024

/azp run regression

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@scholzj
Copy link
Member Author

scholzj commented May 12, 2024

/azp run kraft-regression

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@ppatierno
Copy link
Member

This PR fixes it by reverting the roles to the original state before this change and maintaining the current state.

@scholzj maybe I haven't got the gist of this but I can't see where this fix is happening. I see the PR having some warning and log changes + test but not a fix somewhere in the code. I am sure there is something I am missing, could you elaborate a little bit more where I should look at, please?

@scholzj
Copy link
Member Author

scholzj commented May 13, 2024

@ppatierno In KafkaClusterCreator, line 289 ... addToRoles -> withRoles

@ppatierno
Copy link
Member

@ppatierno In KafkaClusterCreator, line 289 ... addToRoles -> withRoles

:-o ... How could I have missed that??

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.

@scholzj scholzj merged commit e85aaf7 into strimzi:main May 13, 2024
29 checks passed
@scholzj scholzj deleted the improve-the-role-change-reversal branch May 13, 2024 12:15
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