1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-24 07:49:41 +02:00

fix(edgestacks): return 400 instead of 500 on edge stack create when an invalid payload is provided EE-4429 (#7880)

This commit is contained in:
matias-portainer 2022-11-15 17:40:56 -03:00 committed by GitHub
parent 573e05d1c7
commit c21921a08d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 31 additions and 17 deletions

View file

@ -322,19 +322,19 @@ func TestCreateWithInvalidPayload(t *testing.T) {
Name: "Empty swarmStackFromFileContentPayload with string method",
Payload: swarmStackFromFileContentPayload{},
QueryString: "method=string",
ExpectedStatusCode: 500,
ExpectedStatusCode: 400,
},
{
Name: "Empty swarmStackFromFileContentPayload with repository method",
Payload: swarmStackFromFileContentPayload{},
QueryString: "method=repository",
ExpectedStatusCode: 500,
ExpectedStatusCode: 400,
},
{
Name: "Empty swarmStackFromFileContentPayload with file method",
Payload: swarmStackFromFileContentPayload{},
QueryString: "method=file",
ExpectedStatusCode: 500,
ExpectedStatusCode: 400,
},
{
Name: "Duplicated EdgeStack Name",
@ -356,7 +356,7 @@ func TestCreateWithInvalidPayload(t *testing.T) {
DeploymentType: edgeStack.DeploymentType,
},
QueryString: "method=string",
ExpectedStatusCode: 500,
ExpectedStatusCode: 400,
},
{
Name: "EdgeStackDeploymentKubernetes with Docker endpoint",
@ -378,7 +378,7 @@ func TestCreateWithInvalidPayload(t *testing.T) {
DeploymentType: portainer.EdgeStackDeploymentCompose,
},
QueryString: "method=string",
ExpectedStatusCode: 500,
ExpectedStatusCode: 400,
},
{
Name: "Clone Git respository error",