rbd: fix checkHealthyPrimary to consider up+stopped state

we need to check for image should be in up+stopped state
not anyone of the state for that the we need to use
OR check not the AND check.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
(cherry picked from commit 53e76fab69)
This commit is contained in:
Madhu Rajanna 2022-06-28 16:17:02 +05:30 committed by mergify[bot]
parent 4b7f0a0541
commit 0e67c8da24

View File

@ -632,7 +632,7 @@ func checkHealthyPrimary(ctx context.Context, rbdVol *rbdVolume) error {
return fmt.Errorf("failed to get local status: %w", err)
}
if !localStatus.Up && localStatus.State != librbd.MirrorImageStatusStateStopped {
if !localStatus.Up || localStatus.State != librbd.MirrorImageStatusStateStopped {
return fmt.Errorf("%s %w. State is up=%t, state=%q",
rbdVol,
ErrUnHealthyMirroredImage,