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
ceph: fix mon pdb reconcile #6469
Conversation
|
||
existingPDB := &policyv1beta1.PodDisruptionBudget{} | ||
err := r.client.Get(context.TODO(), pdbRequest, existingPDB) | ||
if apierrors.IsNotFound(err) { |
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.
How about this pattern?
if err != nil {
if apierrors.IsNotFound(err) {
// insert lines 71-75 to create the pdb
}
return errors.Wrap(err, "failed to get mon pdb")
}
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.
Yes, this looks like the common pattern used across rook. Changed code to use this format.
@@ -61,9 +64,29 @@ func (r *ReconcileClusterDisruption) reconcileMonPDB(cephCluster *cephv1.CephClu | |||
MinAvailable: &intstr.IntOrString{IntVal: minAvailable}, | |||
}, | |||
} | |||
err := r.reconcileStaticPDB(pdbRequest, pdb) |
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.
How about making these code changes inside reconcileStaticPDB()
? Seems like we would want the update pattern other places as well, right? (or at least it would be a no-op if the minAvailable never changes)
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.
moved changes to reconcileStaticPDB()
method.
updated mon pdb reconcile to delete mon pdb and create a new one when mon count changes in the cluster spec Signed-off-by: Santosh Pillai <sapillai@redhat.com>
updated mon pdb reconcile to delete mon pdb and create a new one when mon count changes in the cluster spec
Tests:
Signed-off-by: Santosh Pillai sapillai@redhat.com
Description of your changes:
Which issue is resolved by this Pull Request:
Resolves #
Checklist:
make codegen
) has been run to update object specifications, if necessary.