Skip to content

Commit

Permalink
Fix the freenas driver DELETE api paths
Browse files Browse the repository at this point in the history
Missed the .../id/... path element.
  • Loading branch information
cvaroqui committed Jul 29, 2024
1 parent dc87c6d commit 42da6dc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/arrayfreenas/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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))
Expand Down

0 comments on commit 42da6dc

Please sign in to comment.