kubernetes-client / c

Official C client library for Kubernetes
Apache License 2.0
146 stars 45 forks source link

Invalid content type trying to get pod logs #179

Closed ahmedyarub closed 7 months ago

ahmedyarub commented 1 year ago

I'm using CoreV1API_readNamespacedPodLog() to get the logs of a specific pod but k8s returns an error mentioning that text/plain is not supported. I rebuilt by removing this line and then it worked! I'm using Docker Desktop 4.17.1 which comes with Kubernetes 1.25.4. I checked the code of that version and it seems to me that that endpoint is supposed to produce plain/text response since at least 2016! Where is the problem exactly? In the client library? My Kubernetes installation?

brendandburns commented 1 year ago

That's odd. The content-type is coming from the OpenAPI schema that describes the Kubernetes API. It's possible that the OpenAPI schema is incompatible with the actual behavior of the Kubernetes API server, since it is manually curated.

What was the specific error message that you saw?

ahmedyarub commented 1 year ago

I have just rebuilt with the unpatched version and tested. Here is the response I had:

{ "kind": "Status", "apiVersion": "v1", "metadata": {}, "status": "Failure", "message": "only the following media types are accepted: application/json, application/yaml, application/vnd.kubernetes.protobuf", "reason": "NotAcceptable", "code": 406 }

I can see the code which adds text/plain support but it doesn't seem to be working. That being said I can't imagine that this bug has been in Kubernetes for 7 years and nobody noticed!

k8s-triage-robot commented 1 year ago

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot commented 8 months ago

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

k8s-triage-robot commented 7 months ago

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/close not-planned

k8s-ci-robot commented 7 months ago

@k8s-triage-robot: Closing this issue, marking it as "Not Planned".

In response to [this](https://github.com/kubernetes-client/c/issues/179#issuecomment-1950754709): >The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. > >This bot triages issues according to the following rules: >- After 90d of inactivity, `lifecycle/stale` is applied >- After 30d of inactivity since `lifecycle/stale` was applied, `lifecycle/rotten` is applied >- After 30d of inactivity since `lifecycle/rotten` was applied, the issue is closed > >You can: >- Reopen this issue with `/reopen` >- Mark this issue as fresh with `/remove-lifecycle rotten` >- Offer to help out with [Issue Triage][1] > >Please send feedback to sig-contributor-experience at [kubernetes/community](https://github.com/kubernetes/community). > >/close not-planned > >[1]: https://www.kubernetes.dev/docs/guide/issue-triage/ Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.