mirror of
https://github.com/TECHNOFAB11/zfs-localpv.git
synced 2025-12-12 06:20:11 +01:00
refact(error): handle errors (#326)
Signed-off-by: aSquare14 <atibhi.a@gmail.com>
This commit is contained in:
parent
62b3a0b7fe
commit
137572552e
1 changed files with 6 additions and 0 deletions
|
|
@ -288,6 +288,9 @@ func CreateVolClone(ctx context.Context, req *csi.CreateVolumeRequest, srcVol st
|
|||
WithName(volName).
|
||||
WithVolumeStatus(zfs.ZFSStatusPending).
|
||||
WithLabels(labels).Build()
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
volObj.Spec = vol.Spec
|
||||
// use the snapshot name same as new volname
|
||||
|
|
@ -342,6 +345,9 @@ func CreateSnapClone(ctx context.Context, req *csi.CreateVolumeRequest, snapshot
|
|||
WithName(volName).
|
||||
WithVolumeStatus(zfs.ZFSStatusPending).
|
||||
Build()
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
volObj.Spec = snap.Spec
|
||||
volObj.Spec.SnapName = strings.ToLower(snapshot)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue