rbdmirror: fix mirroring status on pool and rn

there is a change  from ceph on how the status
of the mirroring will look like,
Adopting with new fields so the status is correctly synced,
And other components might rely on the status too

Signed-off-by: parth-gr <partharora1010@gmail.com>
(cherry picked from commit aa326a9419)
This commit is contained in:
parth-gr authored and Mergify committed 2025-05-15 17:10:54 +00:00
1 parent 063a7c1723
commit b9e24171ab
6 files changed
+291 -1

No files matched your search

+40
View File
@@ -8754,6 +8754,46 @@ StatesSpec
<p>States is the various state for all mirrored images</p>
</td>
</tr>
<tr>
<td>
<code>image_states</code><br/>
<em>
<a href="#ceph.rook.io/v1.StatesSpec">
StatesSpec
</a>
</em>
</td>
<td>
<em>(Optional)</em>
<p>ImageStates is the various state for all mirrored images</p>
</td>
</tr>
<tr>
<td>
<code>group_health</code><br/>
<em>
string
</em>
</td>
<td>
<em>(Optional)</em>
<p>GroupHealth is the health of the mirrored image group</p>
</td>
</tr>
<tr>
<td>
<code>group_states</code><br/>
<em>
<a href="#ceph.rook.io/v1.StatesSpec">
StatesSpec
</a>
</em>
</td>
<td>
<em>(Optional)</em>
<p>GroupStates is the various state for all mirrored image groups</p>
</td>
</tr>
</tbody>
</table>
<h3 id="ceph.rook.io/v1.Module">Module
@@ -187,12 +187,68 @@ spec:
daemon_health:
description: DaemonHealth is the health of the mirroring daemon
type: string
group_health:
description: GroupHealth is the health of the mirrored image group
nullable: true
type: string
group_states:
description: GroupStates is the various state for all mirrored image groups
nullable: true
properties:
error:
description: Error is when the mirroring state is errored
type: integer
replaying:
description: Replaying is when the replay of the mirroring journal is on-going
type: integer
starting_replay:
description: StartingReplay is when the replay of the mirroring journal starts
type: integer
stopped:
description: Stopped is when the mirroring state is stopped
type: integer
stopping_replay:
description: StopReplaying is when the replay of the mirroring journal stops
type: integer
syncing:
description: Syncing is when the image is syncing
type: integer
unknown:
description: Unknown is when the mirroring state is unknown
type: integer
type: object
health:
description: Health is the mirroring health
type: string
image_health:
description: ImageHealth is the health of the mirrored image
type: string
image_states:
description: ImageStates is the various state for all mirrored images
nullable: true
properties:
error:
description: Error is when the mirroring state is errored
type: integer
replaying:
description: Replaying is when the replay of the mirroring journal is on-going
type: integer
starting_replay:
description: StartingReplay is when the replay of the mirroring journal starts
type: integer
stopped:
description: Stopped is when the mirroring state is stopped
type: integer
stopping_replay:
description: StopReplaying is when the replay of the mirroring journal stops
type: integer
syncing:
description: Syncing is when the image is syncing
type: integer
unknown:
description: Unknown is when the mirroring state is unknown
type: integer
type: object
states:
description: States is the various state for all mirrored images
nullable: true
@@ -619,12 +675,68 @@ spec:
daemon_health:
description: DaemonHealth is the health of the mirroring daemon
type: string
group_health:
description: GroupHealth is the health of the mirrored image group
nullable: true
type: string
group_states:
description: GroupStates is the various state for all mirrored image groups
nullable: true
properties:
error:
description: Error is when the mirroring state is errored
type: integer
replaying:
description: Replaying is when the replay of the mirroring journal is on-going
type: integer
starting_replay:
description: StartingReplay is when the replay of the mirroring journal starts
type: integer
stopped:
description: Stopped is when the mirroring state is stopped
type: integer
stopping_replay:
description: StopReplaying is when the replay of the mirroring journal stops
type: integer
syncing:
description: Syncing is when the image is syncing
type: integer
unknown:
description: Unknown is when the mirroring state is unknown
type: integer
type: object
health:
description: Health is the mirroring health
type: string
image_health:
description: ImageHealth is the health of the mirrored image
type: string
image_states:
description: ImageStates is the various state for all mirrored images
nullable: true
properties:
error:
description: Error is when the mirroring state is errored
type: integer
replaying:
description: Replaying is when the replay of the mirroring journal is on-going
type: integer
starting_replay:
description: StartingReplay is when the replay of the mirroring journal starts
type: integer
stopped:
description: Stopped is when the mirroring state is stopped
type: integer
stopping_replay:
description: StopReplaying is when the replay of the mirroring journal stops
type: integer
syncing:
description: Syncing is when the image is syncing
type: integer
unknown:
description: Unknown is when the mirroring state is unknown
type: integer
type: object
states:
description: States is the various state for all mirrored images
nullable: true
+112
View File
@@ -190,12 +190,68 @@ spec:
daemon_health:
description: DaemonHealth is the health of the mirroring daemon
type: string
group_health:
description: GroupHealth is the health of the mirrored image group
nullable: true
type: string
group_states:
description: GroupStates is the various state for all mirrored image groups
nullable: true
properties:
error:
description: Error is when the mirroring state is errored
type: integer
replaying:
description: Replaying is when the replay of the mirroring journal is on-going
type: integer
starting_replay:
description: StartingReplay is when the replay of the mirroring journal starts
type: integer
stopped:
description: Stopped is when the mirroring state is stopped
type: integer
stopping_replay:
description: StopReplaying is when the replay of the mirroring journal stops
type: integer
syncing:
description: Syncing is when the image is syncing
type: integer
unknown:
description: Unknown is when the mirroring state is unknown
type: integer
type: object
health:
description: Health is the mirroring health
type: string
image_health:
description: ImageHealth is the health of the mirrored image
type: string
image_states:
description: ImageStates is the various state for all mirrored images
nullable: true
properties:
error:
description: Error is when the mirroring state is errored
type: integer
replaying:
description: Replaying is when the replay of the mirroring journal is on-going
type: integer
starting_replay:
description: StartingReplay is when the replay of the mirroring journal starts
type: integer
stopped:
description: Stopped is when the mirroring state is stopped
type: integer
stopping_replay:
description: StopReplaying is when the replay of the mirroring journal stops
type: integer
syncing:
description: Syncing is when the image is syncing
type: integer
unknown:
description: Unknown is when the mirroring state is unknown
type: integer
type: object
states:
description: States is the various state for all mirrored images
nullable: true
@@ -621,12 +677,68 @@ spec:
daemon_health:
description: DaemonHealth is the health of the mirroring daemon
type: string
group_health:
description: GroupHealth is the health of the mirrored image group
nullable: true
type: string
group_states:
description: GroupStates is the various state for all mirrored image groups
nullable: true
properties:
error:
description: Error is when the mirroring state is errored
type: integer
replaying:
description: Replaying is when the replay of the mirroring journal is on-going
type: integer
starting_replay:
description: StartingReplay is when the replay of the mirroring journal starts
type: integer
stopped:
description: Stopped is when the mirroring state is stopped
type: integer
stopping_replay:
description: StopReplaying is when the replay of the mirroring journal stops
type: integer
syncing:
description: Syncing is when the image is syncing
type: integer
unknown:
description: Unknown is when the mirroring state is unknown
type: integer
type: object
health:
description: Health is the mirroring health
type: string
image_health:
description: ImageHealth is the health of the mirrored image
type: string
image_states:
description: ImageStates is the various state for all mirrored images
nullable: true
properties:
error:
description: Error is when the mirroring state is errored
type: integer
replaying:
description: Replaying is when the replay of the mirroring journal is on-going
type: integer
starting_replay:
description: StartingReplay is when the replay of the mirroring journal starts
type: integer
stopped:
description: Stopped is when the mirroring state is stopped
type: integer
stopping_replay:
description: StopReplaying is when the replay of the mirroring journal stops
type: integer
syncing:
description: Syncing is when the image is syncing
type: integer
unknown:
description: Unknown is when the mirroring state is unknown
type: integer
type: object
states:
description: States is the various state for all mirrored images
nullable: true
+12
View File
@@ -937,6 +937,18 @@ type MirroringStatusSummarySpec struct {
// +optional
// +nullable
States StatesSpec `json:"states,omitempty"`
// ImageStates is the various state for all mirrored images
// +optional
// +nullable
ImageStates *StatesSpec `json:"image_states,omitempty"`
// GroupHealth is the health of the mirrored image group
// +optional
// +nullable
GroupHealth string `json:"group_health,omitempty"`
// GroupStates is the various state for all mirrored image groups
// +optional
// +nullable
GroupStates StatesSpec `json:"group_states,omitempty"`
}
// StatesSpec are rbd images mirroring state
@@ -3295,7 +3295,7 @@ func (in *MirroringStatus) DeepCopyInto(out *MirroringStatus) {
if in.Summary != nil {
in, out := &in.Summary, &out.Summary
*out = new(MirroringStatusSummarySpec)
**out = **in
(*in).DeepCopyInto(*out)
}
return
}
@@ -3331,6 +3331,12 @@ func (in *MirroringStatusSpec) DeepCopy() *MirroringStatusSpec {
func (in *MirroringStatusSummarySpec) DeepCopyInto(out *MirroringStatusSummarySpec) {
*out = *in
out.States = in.States
if in.ImageStates != nil {
in, out := &in.ImageStates, &out.ImageStates
*out = new(StatesSpec)
**out = **in
}
out.GroupStates = in.GroupStates
return
}
+8
View File
@@ -205,6 +205,14 @@ func GetPoolMirroringStatus(context *clusterd.Context, clusterInfo *ClusterInfo,
return nil, errors.Wrap(err, "failed to unmarshal mirror pool status response")
}
if poolMirroringStatus.Summary != nil {
// for backward compatibility, we need to set the states field
// so to avoid breaking changes in the CRD that rook user might be using
if poolMirroringStatus.Summary.ImageStates != nil {
poolMirroringStatus.Summary.States = *poolMirroringStatus.Summary.ImageStates
}
}
return &poolMirroringStatus, nil
}