From 09f40218f73597e2bd32a00ce327c3e952dbd53e Mon Sep 17 00:00:00 2001 From: Mayank <33252549+mynktl@users.noreply.github.com> Date: Fri, 26 Jul 2019 17:14:14 +0530 Subject: [PATCH] fix(VolumeInfo): skip backup silently if volume is not supported by `velero-plugin` (#32) Signed-off-by: mayank --- pkg/cstor/cstor.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/cstor/cstor.go b/pkg/cstor/cstor.go index 3fa141e5..7af587c1 100644 --- a/pkg/cstor/cstor.go +++ b/pkg/cstor/cstor.go @@ -215,12 +215,13 @@ func (p *Plugin) GetVolumeID(unstructuredPV runtime.Unstructured) (string, error return "", errors.WithStack(err) } + // If PV doesn't have sufficent info to consider as CStor Volume + // then we will return empty volumeId and error as nil. if pv.Name == "" || pv.Spec.StorageClassName == "" || (pv.Spec.ClaimRef != nil && pv.Spec.ClaimRef.Namespace == "") || len(pv.Labels) == 0 { - p.Log.Errorf("Insufficient info for PV : %v", pv) - return "", errors.New("Insufficient info for PV") + return "", nil } volType, ok := pv.Labels[openebsVolumeLabel]