From 42da6dc8db110657a3adfe8f39328ca4a502a59f Mon Sep 17 00:00:00 2001 From: Christophe Varoqui Date: Mon, 29 Jul 2024 14:34:02 +0200 Subject: [PATCH] Fix the freenas driver DELETE api paths Missed the .../id/... path element. --- drivers/arrayfreenas/main.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/arrayfreenas/main.go b/drivers/arrayfreenas/main.go index 5924bea3d..86911f511 100644 --- a/drivers/arrayfreenas/main.go +++ b/drivers/arrayfreenas/main.go @@ -867,7 +867,7 @@ func (t Array) DelZvol(name string) (*Dataset, error) { if !ok { return nil, fmt.Errorf("dataset not found") } - path := fmt.Sprintf("/pool/dataset/%s", dataset.Id) + path := fmt.Sprintf("/pool/dataset/id/%s", dataset.Id) req, err := t.newRequest(http.MethodDelete, path, nil, nil) if err != nil { return dataset, err @@ -881,7 +881,7 @@ func (t Array) DelZvol(name string) (*Dataset, error) { } func (t Array) delISCSIExtent(extent ISCSIExtent) error { - path := fmt.Sprintf("/iscsi/extent/%d", extent.Id) + path := fmt.Sprintf("/iscsi/extent/id/%d", extent.Id) req, err := t.newRequest(http.MethodDelete, path, nil, nil) if err != nil { return err @@ -903,7 +903,7 @@ func (t Array) DelISCSIExtent(opt DelISCSIExtentOptions) (*ISCSIExtent, error) { if opt.Id >= 0 { extent = extents.GetById(opt.Id) } else if opt.Name != "" { - extent = extents.GetByPath("zvol/" + opt.Name) + extent = extents.GetByName(opt.Name) } if extent == nil { return nil, fmt.Errorf("extent %v not found (%d scanned)", opt, len(extents))