Open garribas-atlassian opened 5 months ago
I've tried as well to adapt the examples for PatchUtils, but CustomObjectsApi.patchNamespacedCustomObjectCall
is private?
Object patch =
PatchUtils.patch(
Object.class,
() ->
customObjectsApi.patchNamespacedCustomObjectCall(
group, version, namespace, plural, name,
new V1Patch(applyYamlStr),
null,
null,
null
null,
true,
null),
V1Patch.PATCH_FORMAT_APPLY_YAML,
customObjectsApi.getApiClient());
thanks for reporting this, before we release a fix, please use either 19.x or 20.0.0-legacy to workaround the issue
This bug is also in v20-legacy. Using v19 helps, though.
@yue9944882 any fix for this? I am using patchnamespacedCronJob and I get the same error. Because of that, I had to downgrade to 19.0.0 and management all 3rd party upgrades (due to security issues) manually.
Ok ... I changed everything to use PatchUtil and seems like everything is ok now !
Describe the bug Hello,
I'm trying to patch a custom resource following this official example: https://github.com/kubernetes-client/java/blob/master/kubernetes/docs/CustomObjectsApi.md#patchNamespacedCustomObject
No matter what I specify in the body param (json patch string, yaml patch, a Map with CRD attributes), the result is always an HTTP 415 error response from the server:
Java client Version
20.0.0
Kubernetes Version
1.28
Java Version Corretto-21.0.2
To Reproduce Steps to reproduce the behavior:
Results in:
Expected behavior The expectation is that the above code would modify the CRD.
Using
PatchUtils
doesn't seem an alternative for custom resources since the class to be patched (which would beObject
for a CRD) must be supplied:https://github.com/kubernetes-client/java/blob/master/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/PatchExample.java
`