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

Always use dc.ObjectMeta.Name-pdb for the PodDisruptionBudget #734

Merged
merged 1 commit into from
Nov 19, 2024

Conversation

burmanm
Copy link
Contributor

@burmanm burmanm commented Nov 18, 2024

What this PR does:
Uses the ObjectMeta.Name of the CassandraDatacenter for the pdb name prefix instead of the Spec.DatacenterName

Which issue(s) this PR fixes:
Fixes #720

Checklist

  • Changes manually tested
  • Automated Tests added/updated
  • Documentation added/updated
  • CHANGELOG.md updated (not required for documentation PRs)
  • CLA Signed: DataStax CLA

@burmanm burmanm requested a review from a team as a code owner November 18, 2024 13:28
Copy link

@frivoire frivoire left a comment

Choose a reason for hiding this comment

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

Hello 👋
I'm pretty new in K8ssandra, but I would like to discuss one thing:

@@ -31,7 +31,7 @@ func newPodDisruptionBudgetForDatacenter(dc *api.CassandraDatacenter) *policyv1.

pdb := &policyv1.PodDisruptionBudget{
ObjectMeta: metav1.ObjectMeta{
Name: dc.LabelResourceName() + "-pdb",
Name: dc.Name + "-pdb",
Copy link

@frivoire frivoire Nov 19, 2024

Choose a reason for hiding this comment

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

Why use a -pdb suffix here ?
It seems useless to me, since K8S resource name only needs to be unique for a given kind of resource.

So, I would suggest to:

Suggested change
Name: dc.Name + "-pdb",
Name: dc.Name,

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're right that it would be enough without the pdb suffix, but in this case the name was picked years ago. For most clusters created with cass-operator, this change will make no difference and the backwards compatibility is retained without any extra objects.

@adejanovski adejanovski merged commit 3f699c5 into k8ssandra:master Nov 19, 2024
47 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.

PodDisruptionBudget are not named according to overrides
3 participants