From 3f295885d49f9b5c597b885dc2a75eab51c0d73b Mon Sep 17 00:00:00 2001 From: Nikhil-Ladha Date: Tue, 1 Apr 2025 12:28:30 +0530 Subject: [PATCH] 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 --- internal/rbd/group/volume_group.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/internal/rbd/group/volume_group.go b/internal/rbd/group/volume_group.go index 5ec8acf9b..5a1ec1381 100644 --- a/internal/rbd/group/volume_group.go +++ b/internal/rbd/group/volume_group.go @@ -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