diff --git a/api/server/docker.go b/api/server/docker.go index 11bbaabc2..12b34d115 100644 --- a/api/server/docker.go +++ b/api/server/docker.go @@ -869,6 +869,7 @@ func (d *driver) unmount(w http.ResponseWriter, r *http.Request) { } mountpoint := d.mountpath(nameWithID) + mountpointWithoutID := d.mountpath(name) id := vol.Id if vol.Spec.Scale > 1 { id = v.MountedAt(ctx, mountpoint) @@ -886,6 +887,15 @@ func (d *driver) unmount(w http.ResponseWriter, r *http.Request) { opts := make(map[string]string) opts[options.OptionsDeleteAfterUnmount] = "true" + errWithoutID := v.Unmount(correlation.TODO(), id, mountpointWithoutID, opts) + if errWithoutID != nil { + d.logRequest(method, request.Name).Warnf( + "Cannot unmount volume %v, %v", + mountpointWithoutID, err) + d.errorResponse(method, w, err) + return + } + err = v.Unmount(correlation.TODO(), id, mountpoint, opts) if err != nil { d.logRequest(method, request.Name).Warnf(