Commit e401dc74 authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #45940 from sttts/sttts-204

Automatic merge from submit-queue (batch tested with PRs 42895, 45940) apiserver: no Status in body for http 204 Fixes http writer errors as with 204 we must not send any body. Needed downstream for https://github.com/openshift/origin/issues/14213.
parents a45a1ef2 8902dae1
......@@ -103,6 +103,12 @@ func ErrorNegotiated(err error, s runtime.NegotiatedSerializer, gv schema.GroupV
delay := strconv.Itoa(int(status.Details.RetryAfterSeconds))
w.Header().Set("Retry-After", delay)
}
if code == http.StatusNoContent {
w.WriteHeader(code)
return code
}
WriteObjectNegotiated(s, gv, w, req, code, status)
return code
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment