Bug 1605229
| Summary: | MutatingAdmissionWebhook hardcoded to return as ERROR | ||
|---|---|---|---|
| Product: | OpenShift Container Platform | Reporter: | jolee |
| Component: | kube-apiserver | Assignee: | Stefan Schimanski <sttts> |
| Status: | CLOSED WONTFIX | QA Contact: | Xingxing Xia <xxia> |
| Severity: | low | Docs Contact: | |
| Priority: | low | ||
| Version: | 3.9.0 | CC: | aos-bugs, denverjanke, jack.ottofaro, jmatthew, jokerman, jolee, maszulik, mfojtik, mmccomas |
| Target Milestone: | --- | ||
| Target Release: | 4.3.0 | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2020-05-05 15:29:10 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
jolee
2018-07-20 13:39:39 UTC
Which message exactly? This needs more detail. Regardless of the status code returned by an admission webhook, a 500 error code is returned to the client. Only the 'message' is retained.
Eg. When trying to create a project (namespace) the below json is returned from the webhook.
{
"kind": "AdmissionReview",
"apiVersion": "admission.k8s.io/v1beta1",
"response": {
"uid": "<request uid>",
"allowed": false,
"status": {
"status": "Failure",
"message": "Not a valid project name",
"reason": "Invalid",
"details": {
"name": "test"
},
"code": 422
}
}
}
But the below json is returned to the client.
[{
"metadata": {},
"status": "Failure",
"message": "Internal error occurred: admission webhook \"validator.example.com\" denied the request: Not a valid project name",
"reason": "InternalError",
"details": {
"causes": [
{
"message": "admission webhook \"validator.example.com\" denied the request: Not a valid project name"
}
]
},
"code": 500
}]
Worked on upstream: https://github.com/kubernetes/kubernetes/pull/69520 upstream fix: https://github.com/kubernetes/kubernetes/pull/72751 This will be in 4.3 through the rebase onto 1.15 if there are no strong reasons for a backport. |