Allow api volume detach requests without a detachInput body
This way current ui does not need to be modified to send a detachInput
with an empty hostId. This can be removed in the future when we want to
require a detachInput to be always sent.
@@ -209,7 +209,9 @@ func (s *Server) VolumeDetach(rw http.ResponseWriter, req *http.Request) error {
apiContext := api.GetApiContext(req)
if err := apiContext.Read(&input); err != nil {
- return err
+ // HACK: for ui detach requests that don't send a body
+ // This is the same as previous behavior where detach is requested from all nodes
+ input.HostID = ""
}
id := mux.Vars(req)["name"]
