mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-04-11 18:13:00 +00:00
rbd: cleanup volume info from group even if image is not part of group
we should continue to cleanup the volume info like the omap data, mappings from the group if the image is not part of the goup anymore. Signed-off-by: Nikhil-Ladha <nikhilladha1999@gmail.com>
This commit is contained in:
parent
2fe7dbe2af
commit
23fce43925
@ -255,11 +255,10 @@ func (vg *volumeGroup) RemoveVolume(ctx context.Context, vol types.Volume) error
|
||||
|
||||
err := vol.RemoveFromGroup(ctx, vg)
|
||||
if err != nil {
|
||||
if errors.Is(err, librbd.ErrNotExist) {
|
||||
return nil
|
||||
if !errors.Is(err, librbd.ErrNotExist) {
|
||||
return fmt.Errorf("failed to remove volume %q from volume group %q: %w", vol, vg, err)
|
||||
}
|
||||
|
||||
return fmt.Errorf("failed to remove volume %q from volume group %q: %w", vol, vg, err)
|
||||
log.DebugLog(ctx, "volume %q doesn't exist in group", vol)
|
||||
}
|
||||
|
||||
// toRemove contain the ID of the volume that is removed from the group
|
||||
|
Loading…
Reference in New Issue
Block a user