-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Content type for PATCH sub resource requests is incorrect #3143
Comments
Yeah, there's lots of errors in the upstream YAML. We try to fix them when we find them. |
Thanks @brendandburns. This path has worked. Working code snippet following my problem description for posterity var customObjectsApi = new CustomObjectsApi(apiClient);
PatchUtils.patch(
Foo.class,
() ->
customObjectsApi.patchNamespacedCustomObjectStatus(
API_GROUP, "v1", foo.getMetadata().getNamespace(), "foos",
foo.getMetadata().getName(),
new V1Patch(String.format(JSON_PATH_TEMPLATE, newPodsSize))
).buildCall(null),
V1Patch.PATCH_FORMAT_JSON_PATCH,
customObjectsApi.getApiClient()
) The |
Using PatchUtils is a workaround at best. This bug also makes GenericKubernetesApi's patch and updateStatus unusable. The cause is the wrong (static) choice of mimetype. |
This is a duplicate of #3106 |
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 |
/remove-lifecycle stale |
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 |
I'm touching this bug as I'm hitting the same issue. @brendandburns, would you be open to a PR to make GenericKubernetesApi.updateStatus() and patch() use the PatchUtils internally? |
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 |
/remove-lifecycle rotten |
Describe the bug
Patching status subresource of a CRD always fails with java client.
Client Version
20.0.0
Kubernetes Version
1.29.1
Java Version
Java 17
To Reproduce
Above code always fails with the following error
Expected behavior
This call is expected to succeed.
KubeConfig
If applicable, add a KubeConfig file with secrets redacted.
Server (please complete the following information):
Additional context
The equivalent call from kubectl succeeds -
kubectl patch foos.foo.bar foo1 --subresource=status --type=json -p '[{"op":"replace","path":"/status","value":{"availableReplicas":20}}]'
In
kubernetes/api/openapi.yaml
, operationId: patchNamespacedCustomObject has the content type defined asapplication/json
, which seem to be incorrect.The text was updated successfully, but these errors were encountered: