-
Notifications
You must be signed in to change notification settings - Fork 79
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
Prevent changes of DC name or both adding and removing a DC at the same time. K8OP-263 #1426
Conversation
a6adb65
to
956754b
Compare
Quality Gate passedIssues Measures |
@burmanm, could you do another round of review now that @Miles-Garnsey addressed your comments? Thanks! |
I've approved due to time constraint, even if the reconcile process isn't really unit tested, but hopefully that is addressed next week. |
@@ -172,7 +173,9 @@ func (r *K8ssandraCluster) ValidateUpdate(old runtime.Object) (admission.Warning | |||
if err := validateUpdateNumTokens(oldCluster.Spec.Cassandra, r.Spec.Cassandra); err != nil { | |||
return nil, err | |||
} | |||
|
|||
if DcRemoved(oldCluster.Spec, r.Spec) && DcAdded(oldCluster.Spec, r.Spec) { | |||
return nil, fmt.Errorf("renaming, as well as adding and removing DCs at the same time is prohibited as it can cause data loss") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] It would be nice to also include the names of the removed and added DCs.
…me time. K8OP-263 (#1426) * Prevent changes of DC name or both adding and removing a DC at the same time.
What this PR does:
Fixes #1422
Which issue(s) this PR fixes:
Fixes #
Checklist