Skip to content

Commit

Permalink
Do not mask post-attach inspect errors (#1204)
Browse files Browse the repository at this point in the history
Signed-off-by: veda <[email protected]>
  • Loading branch information
talakad authored Aug 27, 2019
1 parent 636d0e4 commit fc6a1bb
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions api/server/volume.go
Original file line number Diff line number Diff line change
Expand Up @@ -429,11 +429,19 @@ func (vd *volAPI) volumeSet(w http.ResponseWriter, r *http.Request) {
})
if err2 != nil {
resp.Volume = &api.Volume{}
if req.Action.IsAttach() {
resp.VolumeResponse = &api.VolumeResponse{
Error: responseStatus(err2),
}
}
} else {
resp.Volume = resVol.GetVolume()
}
resp.VolumeResponse = &api.VolumeResponse{
Error: responseStatus(err),
// Do not clear inspect err for attach
if err != nil {
resp.VolumeResponse = &api.VolumeResponse{
Error: responseStatus(err),
}
}
json.NewEncoder(w).Encode(resp)

Expand Down

0 comments on commit fc6a1bb

Please sign in to comment.