Skip to content

Commit

Permalink
fix(VolumeInfo): skip backup silently if volume is not supported by `…
Browse files Browse the repository at this point in the history
…velero-plugin` (#32)

Signed-off-by: mayank <[email protected]>
  • Loading branch information
mynktl authored and vishnuitta committed Jul 26, 2019
1 parent 0416fb7 commit 09f4021
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/cstor/cstor.go
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit 09f4021

Please sign in to comment.