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

[CORE-119212] - Add/fix pdb for controllers #94

Merged
merged 5 commits into from
Jan 10, 2025
Merged

[CORE-119212] - Add/fix pdb for controllers #94

merged 5 commits into from
Jan 10, 2025

Conversation

hvan
Copy link
Collaborator

@hvan hvan commented Dec 20, 2024

Description

Please provide a meaningful description of what this change will do, or is for. Bonus points for including links to
related issues, other PRs, or technical references.

Note that by not including a description, you are asking reviewers to do extra work to understand the context of this
change, which may lead to your PR taking much longer to review, or result in it not being reviewed at all.

Type of Change

  • Bug Fix
  • New Feature
  • Breaking Change
  • Refactor
  • Documentation
  • Other (please describe)

Checklist

  • I have read the contributing guidelines
  • Existing issues have been referenced (where applicable)
  • I have verified this change is not present in other open pull requests
  • Functionality is documented
  • All code style checks pass
  • New code contribution is covered by automated tests
  • All new and existing tests pass

@hvan hvan marked this pull request as draft December 20, 2024 21:18
@hvan hvan marked this pull request as ready for review January 9, 2025 15:49
}
}

func expectKafkaPDBZK(ctx context.Context, kafkaCluster *v1beta1.KafkaCluster) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Separate test for ZK and KRaft

}).WithTimeout(1000).Should(MatchError(fmt.Sprintf("poddisruptionbudgets.policy \"%s-controller-pdb\" not found", kafkaCluster.Name)))
}

func expectKafkaPDBKraft(ctx context.Context, kafkaCluster *v1beta1.KafkaCluster) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Separate test for ZK and KRaft

minAvailable)
}

func (r *Reconciler) podDisruptionBudgetControllers(log logr.Logger) (runtime.Object, error) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we need to add some functional tests for the new functions?

},
},
}, nil
}

func (r *Reconciler) getControllerCount() (int, error) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

See above note


// Calculate minAvailable as max between brokerCount - 1 (so we only allow 1 controller to be disrupted)
// and 1 (case when there is only 1 controller)
func (r *Reconciler) computeControllerMinAvailable() (intstr.IntOrString, error) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

See above note about functional tests

@hvan hvan merged commit 1b56507 into kraft Jan 10, 2025
6 checks passed
@hvan hvan deleted the kraft-pdb branch January 10, 2025 17:49
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.

3 participants