mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-03 17:30:00 +00:00
Merge pull request #516 from smarterclayton/operation_server_not_returning
Operation server was not returning in error cases
This commit is contained in:
commit
a52f38f37c
@ -164,6 +164,7 @@ func (server *APIServer) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
|||||||
http.StatusOK,
|
http.StatusOK,
|
||||||
http.StatusAccepted,
|
http.StatusAccepted,
|
||||||
http.StatusConflict,
|
http.StatusConflict,
|
||||||
|
http.StatusNotFound,
|
||||||
),
|
),
|
||||||
).Log()
|
).Log()
|
||||||
|
|
||||||
@ -352,6 +353,7 @@ func (server *APIServer) handleREST(parts []string, req *http.Request, w http.Re
|
|||||||
body, err := server.readBody(req)
|
body, err := server.readBody(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
server.error(err, w)
|
server.error(err, w)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
obj, err := storage.Extract(body)
|
obj, err := storage.Extract(body)
|
||||||
if IsNotFound(err) {
|
if IsNotFound(err) {
|
||||||
@ -391,6 +393,7 @@ func (server *APIServer) handleOperationRequest(w http.ResponseWriter, req *http
|
|||||||
}
|
}
|
||||||
if req.Method != "GET" {
|
if req.Method != "GET" {
|
||||||
server.notFound(req, w)
|
server.notFound(req, w)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
if len(parts) == 0 {
|
if len(parts) == 0 {
|
||||||
// List outstanding operations.
|
// List outstanding operations.
|
||||||
@ -402,6 +405,7 @@ func (server *APIServer) handleOperationRequest(w http.ResponseWriter, req *http
|
|||||||
op := server.ops.Get(parts[0])
|
op := server.ops.Get(parts[0])
|
||||||
if op == nil {
|
if op == nil {
|
||||||
server.notFound(req, w)
|
server.notFound(req, w)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
obj, complete := op.StatusOrResult()
|
obj, complete := op.StatusOrResult()
|
||||||
|
Loading…
Reference in New Issue
Block a user