Skip to content

Commit

Permalink
Merge pull request #378 from Rakshith-R/BZ-mirror-check
Browse files Browse the repository at this point in the history
BUG 2311885: rbd: fail DisableVolumeReplication() if image is not mirror disabled
  • Loading branch information
openshift-merge-bot[bot] authored Sep 13, 2024
2 parents ffd92a4 + 431f1c3 commit 79eb51d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions internal/rbd/replication.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,10 @@ func DisableVolumeReplication(mirror types.Mirror,
return fmt.Errorf("failed to get mirroring info of image: %w", err)
}

if info.GetState() == librbd.MirrorImageDisabling.String() {
return fmt.Errorf("%w: image is in disabling state", ErrAborted)
// error out if the image is not in disabled state.
if info.GetState() != librbd.MirrorImageDisabled.String() {
return fmt.Errorf("%w: image is in %q state, expected state %q", ErrAborted,
info.GetState(), librbd.MirrorImageDisabled.String())
}

return nil
Expand Down

0 comments on commit 79eb51d

Please sign in to comment.