Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation incorrectly states no API server application/yaml support #48317

Open
sftim opened this issue Oct 13, 2024 · 5 comments
Open

Documentation incorrectly states no API server application/yaml support #48317

sftim opened this issue Oct 13, 2024 · 5 comments
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug. language/en Issues or PRs related to English language priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. triage/accepted Indicates an issue or PR is ready to be actively worked on. wg/api-expression Categorizes an issue or PR as relevant to WG API Expression.

Comments

@sftim
Copy link
Contributor

sftim commented Oct 13, 2024

This is a Bug Report

Problem:
Kubernetes' API server supports YAML (for encoding request bodies, or for a negotiated response format), but the documentation says it does not.

Proposed Solution:
Add a section within https://kubernetes.io/docs/reference/using-api/api-concepts/#alternate-representations-of-resources about application/yaml, and remove the note that says you can't use YAML.

Also see #48317 (comment)

Page to Update:
https://kubernetes.io/docs/reference/using-api/api-concepts/#alternate-representations-of-resources

Additional Information:
/language en
/kind bug
/triage accepted
/priority important-longterm
/wg api-expression

@sftim sftim added the kind/bug Categorizes issue or PR as related to a bug. label Oct 13, 2024
@k8s-ci-robot k8s-ci-robot added language/en Issues or PRs related to English language triage/accepted Indicates an issue or PR is ready to be actively worked on. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. wg/api-expression Categorizes an issue or PR as relevant to WG API Expression. labels Oct 13, 2024
@tengqm
Copy link
Contributor

tengqm commented Oct 13, 2024

Also the code returned when an unsupported media-type is specified should be 415. E.g.

{
  "kind": "Status",
  "apiVersion": "v1",
  "metadata": {},
  "status": "Failure",
  "message": "the body of the request was in an unknown format - accepted media types include: application/json, application/yaml, application/vnd.kubernetes.protobuf",
  "reason": "UnsupportedMediaType",
  "code": 415
}

@sftim
Copy link
Contributor Author

sftim commented Oct 13, 2024

AIUI it's 415 for unacceptable request bodies, and 406 Not acceptable if you try something like:

GET /api/v1/pods HTTP/1.1
…
Accept: application/fictional

(ie, when there's an empty intersection between server supported response types and client accepted media types)

@tengqm
Copy link
Contributor

tengqm commented Oct 13, 2024

Experiments showed that:

  • Unacceptable Accept header leads to 406: Not Acceptable;
  • Unacceptable Content-Type header leads to 415 UnsupportedMediaType.

@sftim
Copy link
Contributor Author

sftim commented Oct 14, 2024

/retitle Documentation incorrectly states no API server application/yaml support

Describing the bug, not the fix

@k8s-ci-robot k8s-ci-robot changed the title Document API server application/yaml support Documentation incorrectly states no API server application/yaml support Oct 14, 2024
@abhilasha2418
Copy link
Contributor

/assign

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. language/en Issues or PRs related to English language priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. triage/accepted Indicates an issue or PR is ready to be actively worked on. wg/api-expression Categorizes an issue or PR as relevant to WG API Expression.
Projects
None yet
Development

No branches or pull requests

4 participants