File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -168,11 +168,11 @@ func (y *YarnCopilotServer) KillContainer(ctx *gin.Context) {
168168 }
169169 container , err := y .mgr .GetContainer (kr .ContainerID )
170170 if err != nil {
171- ctx .JSON (http .StatusBadRequest , err )
171+ ctx .JSON (http .StatusInternalServerError , err )
172172 return
173173 }
174174 if err := y .mgr .KillContainer (kr .ContainerID ); err != nil {
175- ctx .JSON (http .StatusBadRequest , err )
175+ ctx .JSON (http .StatusInternalServerError , err )
176176 return
177177 }
178178 ctx .JSON (http .StatusOK , KillInfo {Items : []* ContainerInfo {ParseContainerInfo (container , y .mgr )}})
Original file line number Diff line number Diff line change @@ -233,14 +233,14 @@ func TestYarnCopilotServer_KillContainer(t *testing.T) {
233233 assert .Equal (t , "container_e517_1746198264116_5225_01_000003" , killInfo .Items [0 ].Name )
234234
235235 // 测试错误情况
236- mockMgr .err1 = assert .AnError
236+ mockMgr .err2 = assert .AnError
237237 w = httptest .NewRecorder ()
238238 c , _ = gin .CreateTestContext (w )
239239 c .Request = httptest .NewRequest ("POST" , "/v1/killContainer" , bytes .NewBuffer (body ))
240240
241241 server .KillContainer (c )
242242
243- assert .Equal (t , http .StatusBadRequest , w .Code )
243+ assert .Equal (t , http .StatusInternalServerError , w .Code )
244244}
245245
246246func TestYarnCopilotServer_KillContainersByResource (t * testing.T ) {
You can’t perform that action at this time.
0 commit comments