[KEP:4827] Structured statusz#134313
Conversation
|
Skipping CI for Draft Pull Request. |
|
This issue is currently awaiting triage. If a SIG or subproject determines this is a relevant issue, they will accept it by applying the The DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
23ccc1a to
564ed3f
Compare
fb0c524 to
99f472d
Compare
99f472d to
6e7fded
Compare
afeccb9 to
5b82b75
Compare
|
This PR may require API review. If so, when the changes are ready, complete the pre-review checklist and request an API review. Status of requested reviews is tracked in the API Review project. |
862651d to
7e359e2
Compare
| case "application/json": | ||
| if mediaType.Convert == nil || mediaType.Convert.GroupVersion() != schemeGroupVersion { | ||
| utilruntime.HandleError(fmt.Errorf("expected statusz group version, got group: %s, version %s", mediaType.Convert.Group, mediaType.Convert.Version)) | ||
| w.WriteHeader(http.StatusInternalServerError) |
There was a problem hiding this comment.
I don't think it's possible to get here... a request that doesn't set these gets a not-acceptable error response, right?
There was a problem hiding this comment.
Followed the same pattern as in discovery but yeah seems redundant. Removed.
|
an integration test that turns on the feature and actually hits the /statusz endpoint with the few accept types to exercise success cases and error cases would build confidence all the wiring works like we want |
7e359e2 to
79eb233
Compare
Found existing integration tests for apiserver, scheduler and kcm which I have updated to check for both text and json responses. There's still some remaining clean up to do for unit tests in kubelet and kube-proxy (which only validate the text response currently) which I can do in a follow up. |
liggitt
left a comment
There was a problem hiding this comment.
a couple last comments, then lgtm
|
/lgtm |
|
LGTM label has been added. DetailsGit tree hash: ff8faea7221b6f35b8ec2164778c5126929aa382 |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: liggitt, richabanker The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/lgtm |
|
LGTM label has been added. DetailsGit tree hash: 99981844958d2e43e4171eda0ea667c0721c6cdf |
What type of PR is this?
/kind feature
What this PR does / why we need it:
Adds an alphav1 structured response for /statusz endpoint
Which issue(s) this PR is related to:
KEP: kubernetes/enhancements#4827
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:
Tested on a kind cluster
Plain/text response returned by default if no Accept header is provided
Structured JSON is returned if correct Accept header is provided