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

Client supports Patching only full resource objects #2645

Closed
saparaj opened this issue Dec 1, 2020 · 1 comment
Closed

Client supports Patching only full resource objects #2645

saparaj opened this issue Dec 1, 2020 · 1 comment

Comments

@saparaj
Copy link

saparaj commented Dec 1, 2020

Hi Fabric8io Team,

Client only support patching full resource objects at the moment. I tried
client.services().inNamespace(namespace).withName(resource.getMetadata().getName()).patch((Service)resource)

I could see we have this handlePatch method:

protected <T> T handlePatch(T current, T updated, Class<T> type) throws ExecutionException, InterruptedException, IOException {

where we are finding a json diff between server and updated yaml using zjsonpatch and sending patch request to server.

I think it would be nice if we supported patch like this:
kubectl patch deployment patch-demo --patch 'spec:\n template:\n spec:\n containers:\n - name: patch-demo-ctr-2\n image: redis'

Official K8sClient has methods to support Strategic Merge Patch and JSON Patch.
https://github.com/kubernetes-client/java/blob/master/examples/examples-release-11/src/main/java/io/kubernetes/client/examples/PatchExample.java

Is there something similar present in Fabric8Io Client like above?

Thanks,
Swarda

@saparaj saparaj changed the title Client supports Patching Only full resource objects Client supports Patching only full resource objects Dec 1, 2020
@stale
Copy link

stale bot commented Apr 8, 2021

This issue has been automatically marked as stale because it has not had any activity since 90 days. It will be closed if no further activity occurs within 7 days. Thank you for your contributions!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants