From 3e5713f2dbd423efd6707883fe1e6ba54f25fa47 Mon Sep 17 00:00:00 2001 From: Niels de Vos Date: Tue, 1 Oct 2024 10:37:35 +0200 Subject: [PATCH] rbd: have `GetVolumeGroup()` return an empty volume group if it was not found Signed-off-by: Niels de Vos --- internal/rbd/group/volume_group.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/internal/rbd/group/volume_group.go b/internal/rbd/group/volume_group.go index 594797faea80..22c66616488a 100644 --- a/internal/rbd/group/volume_group.go +++ b/internal/rbd/group/volume_group.go @@ -71,6 +71,12 @@ func GetVolumeGroup( attrs, err := vg.getVolumeGroupAttributes(ctx) if err != nil { + if errors.Is(librbd.ErrNotFound, err) { + log.DebugLog(ctx, "%v, returning empty volume group %q", vg, err) + + return vg, err + } + return nil, fmt.Errorf("failed to get volume attributes for id %q: %w", vg, err) }