From 42d9dfba360b9e520fd34f3de2d2c73f9c369eb7 Mon Sep 17 00:00:00 2001 From: Chaim Lev-Ari Date: Wed, 15 May 2024 08:27:44 +0300 Subject: [PATCH] fix(docker/volumes): return 409 on volume conflict [EE-6748] (#11691) --- api/http/proxy/factory/docker/volumes.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/api/http/proxy/factory/docker/volumes.go b/api/http/proxy/factory/docker/volumes.go index 1d8101321..5b60ea63a 100644 --- a/api/http/proxy/factory/docker/volumes.go +++ b/api/http/proxy/factory/docker/volumes.go @@ -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") } }