Merge pull request #16520 from parth-gr/fix-rn-status

rbdmirror: fix mirroring monitoring settings for rn
This commit is contained in:
Travis Nielsen authored and GitHub committed 2025-09-26 14:48:01 -05:00
commit c069e73c91
4 files changed
+13 -10

No files matched your search

+6 -3
View File
@@ -180,7 +180,10 @@ func updateRadosNamespaceStatusMirroring(c *mirrorChecker, mirrorStatus *cephv1.
if blockPool.Spec.StatusCheck.Mirror.Disabled {
logger.Debugf("mirroring status check is disabled for %q", c.namespacedName.Name)
return
mirrorStatus = nil
mirrorInfo = nil
snapSchedStatus = nil
details = ""
}
// Update the CephBlockPoolRadosNamespace CR status field
@@ -222,7 +225,7 @@ func toCustomResourceStatus(currentStatus *cephv1.MirroringStatusSpec, mirroring
mirroringInfoSpec.Details = details
if currentInfo != nil {
mirroringInfoSpec.LastChanged = currentInfo.LastChecked
mirroringInfoSpec.LastChanged = currentInfo.LastChanged
}
// snapSchedStatus will be nil in case of an error to fetch it
@@ -234,7 +237,7 @@ func toCustomResourceStatus(currentStatus *cephv1.MirroringStatusSpec, mirroring
snapshotScheduleStatusSpec.Details = details
if currentSnapSchedStatus != nil {
snapshotScheduleStatusSpec.LastChanged = currentSnapSchedStatus.LastChecked
snapshotScheduleStatusSpec.LastChanged = currentSnapSchedStatus.LastChanged
}
return mirroringStatusSpec, mirroringInfoSpec, snapshotScheduleStatusSpec
+4 -4
View File
@@ -392,9 +392,9 @@ func (r *ReconcileCephBlockPool) reconcile(request reconcile.Request) (reconcile
if blockPoolContextsExists && r.blockPoolContexts[blockPoolChannelKey].started {
logger.Info("stop monitoring the mirroring status of the pool %q", cephBlockPool.Name)
r.cancelMirrorMonitoring(cephBlockPool)
// Reset the MirrorHealthCheckSpec
checker.UpdateStatusMirroring(nil, nil, nil, "")
}
// Reset the MirrorHealthCheckSpec
checker.UpdateStatusMirroring(nil, nil, nil, "")
} else {
// Start monitoring of the pool
if r.blockPoolContexts[blockPoolChannelKey].started {
@@ -423,9 +423,9 @@ func (r *ReconcileCephBlockPool) reconcile(request reconcile.Request) (reconcile
// Stop monitoring the mirroring status of this pool
if blockPoolContextsExists && r.blockPoolContexts[blockPoolChannelKey].started {
r.cancelMirrorMonitoring(cephBlockPool)
// Reset the MirrorHealthCheckSpec
checker.UpdateStatusMirroring(nil, nil, nil, "")
}
// Reset the MirrorHealthCheckSpec
checker.UpdateStatusMirroring(nil, nil, nil, "")
}
if statusErr != nil {
+1 -1
View File
@@ -562,7 +562,7 @@ func TestCephBlockPoolController(t *testing.T) {
err = r.client.Get(context.TODO(), req.NamespacedName, pool)
assert.NoError(t, err)
assert.Equal(t, cephv1.ConditionReady, pool.Status.Phase)
assert.Nil(t, pool.Status.MirroringStatus)
assert.Equal(t, pool.Status.MirroringStatus, &cephv1.MirroringStatusSpec{})
})
}
@@ -594,9 +594,9 @@ func (r *ReconcileCephBlockPoolRadosNamespace) reconcileMirroring(cephBlockPoolR
// Stop monitoring the mirroring status of this radosNamespace
if radosNamespaceContextsExists && r.radosNamespaceContexts[radosNamespaceChannelKey].started {
r.cancelMirrorMonitoring(radosNamespaceChannelKey)
// Reset the MirrorHealthCheckSpec
checker.UpdateStatusMirroring(nil, nil, nil, "")
}
// Reset the MirrorHealthCheckSpec
checker.UpdateStatusMirroring(nil, nil, nil, "")
}
return nil