Skip to content

Commit fc87334

Browse files
committed
Fix detach volume client errors to return 409
1 parent 35fe630 commit fc87334

File tree

3 files changed

+195
-172
lines changed

3 files changed

+195
-172
lines changed

cmd/api/api/instances.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -757,7 +757,7 @@ func (s *ApiService) DetachVolume(ctx context.Context, request oapi.DetachVolume
757757
Message: err.Error(),
758758
}, nil
759759
case errors.Is(err, instances.ErrInvalidState), errors.Is(err, volumes.ErrInUse), errors.Is(err, volumes.ErrAmbiguousName):
760-
return oapi.DetachVolume500JSONResponse{
760+
return oapi.DetachVolume409JSONResponse{
761761
Code: "invalid_state",
762762
Message: err.Error(),
763763
}, nil

0 commit comments

Comments
 (0)