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>
This commit is contained in:
Madhu Rajanna 2022-06-28 16:17:02 +05:30 committed by mergify[bot]
parent 704cb5c941
commit 53e76fab69

View File

@ -633,7 +633,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,