From 4b13e9132b5f81aa2cab4c896b5cf50b626aee33 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 bb1247e4c..da6824356 100644 --- a/internal/rbd/group/volume_group.go +++ b/internal/rbd/group/volume_group.go @@ -74,6 +74,12 @@ func GetVolumeGroup( attrs, err := vg.getVolumeGroupAttributes(ctx) if err != nil { + if errors.Is(err, librbd.ErrNotFound) { + log.ErrorLog(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) }