fix(docker/volumes): return 409 on volume conflict [EE-6748] (#11691)

pull/11833/head
Chaim Lev-Ari 2024-05-15 08:27:44 +03:00 committed by GitHub
parent a808f83e7d
commit 42d9dfba36
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 1 deletions

View File

@ -150,7 +150,9 @@ func (transport *Transport) decorateVolumeResourceCreationOperation(request *htt
_, err = cli.VolumeInspect(context.Background(), volumeID)
if err == nil {
return nil, errors.New("a volume with the same name already exists")
return &http.Response{
StatusCode: http.StatusConflict,
}, errors.New("a volume with the same name already exists")
}
}