kubernetes-client / java

Official Java client library for kubernetes
http://kubernetes.io/
Apache License 2.0
3.55k stars 1.89k forks source link

Lack of content types in patchNamespacedDeploymentCall #3189

Closed kozjan closed 1 month ago

kozjan commented 6 months ago

Describe the bug I am migrating from client version v19.0.0. When using AppsV1Api::patchNamespacedDeploymentCall, I get an error:

io.kubernetes.client.openapi.ApiException: Message: 
HTTP response code: 415
HTTP response body: 
{
    "kind": "Status",
    "apiVersion": "v1",
    "metadata": {},
    "status": "Failure",
    "message": "415: Unsupported Media Type",
    "reason": "UnsupportedMediaType",
    "details": {},
    "code": 415
}

I see that v19.0.0 defines more content types:

final String[] localVarContentTypes = {
    "application/json-patch+json", "application/merge-patch+json", "application/strategic-merge-patch+json", "application/apply-patch+yaml"
};

compared to v20.0.0:

final String[] localVarContentTypes = {
    "application/json"
};

Is there any reason for this?

Client Version v20.0.0

Kubernetes Version 1.24

Java Version Java 8

To Reproduce Steps to reproduce the behavior:

Expected behavior K8s accepts the request without problems.

KubeConfig If applicable, add a KubeConfig file with secrets redacted.

Server (please complete the following information):

Additional context Add any other context about the problem here.

brendandburns commented 6 months ago

you should use PatchUtils

oreissig commented 6 months ago

you should use PatchUtils

This works as a workaround, but in fact this really is a bug in the client.

Looks related to https://github.com/kubernetes-client/java/issues/3106

k8s-triage-robot commented 3 months 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 2 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 1 month 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 1 month ago

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

In response to [this](https://github.com/kubernetes-client/java/issues/3189#issuecomment-2281781768): >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-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository.