From d45b41a0b0e683d86e33f05d006320b55a0775f0 Mon Sep 17 00:00:00 2001 From: Lars Lehtonen Date: Wed, 6 May 2026 10:16:43 -0700 Subject: [PATCH] api/server: fix redundant v.AttachPath checks Signed-off-by: Lars Lehtonen --- api/server/docker.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/api/server/docker.go b/api/server/docker.go index 2073cffa6..6ab928b46 100644 --- a/api/server/docker.go +++ b/api/server/docker.go @@ -375,8 +375,8 @@ func (d *driver) create(w http.ResponseWriter, r *http.Request) { if source != nil && len(source.Parent) != 0 { // clone _, err = volumes.Clone(ctx, &api.SdkVolumeCloneRequest{ - Name: name, - ParentId: source.Parent, + Name: name, + ParentId: source.Parent, AdditionalLabels: locator.GetVolumeLabels(), }) } else { @@ -775,7 +775,7 @@ func (d *driver) list(w http.ResponseWriter, r *http.Request) { volInfo := make([]volumeInfo, len(vols)) for i, v := range vols { volInfo[i].Name = v.Locator.Name - if len(v.AttachPath) > 0 || len(v.AttachPath) > 0 { + if len(v.AttachPath) > 0 { volInfo[i].Mountpoint = path.Join(v.AttachPath[0], config.DataDir) } } @@ -800,7 +800,7 @@ func (d *driver) path(w http.ResponseWriter, r *http.Request) { } d.logRequest(method, name).Debugf("") - if len(vol.AttachPath) == 0 || len(vol.AttachPath) == 0 { + if len(vol.AttachPath) == 0 { e := d.volNotMounted(method, name) d.errorResponse(method, w, e) return @@ -833,7 +833,7 @@ func (d *driver) get(w http.ResponseWriter, r *http.Request) { } volInfo := volumeInfo{Name: returnName} - if len(vol.AttachPath) > 0 || len(vol.AttachPath) > 0 { + if len(vol.AttachPath) > 0 { volInfo.Mountpoint = path.Join(vol.AttachPath[0], config.DataDir) }