From 348bcb98f55019ed159ca7e5b71a48013f7cb332 Mon Sep 17 00:00:00 2001 From: TwiN <15699766+TwinProduction@users.noreply.github.com> Date: Fri, 2 Nov 2018 10:12:21 -0400 Subject: [PATCH 1/3] Add merge in ProtoClient --- .../java/io/kubernetes/client/ProtoClient.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/util/src/main/java/io/kubernetes/client/ProtoClient.java b/util/src/main/java/io/kubernetes/client/ProtoClient.java index 780ae423f3..d985864594 100644 --- a/util/src/main/java/io/kubernetes/client/ProtoClient.java +++ b/util/src/main/java/io/kubernetes/client/ProtoClient.java @@ -131,6 +131,20 @@ public ObjectOrStatus update( T obj, String path, String apiVersion, String kind) throws ApiException, IOException { return request(obj.newBuilderForType(), path, "PUT", obj, apiVersion, kind); } + + /** + * Merge a Kubernetes API object using protocol buffer encoding. Performs a PATCH + * + * @param obj The object to merge + * @param path The URL path to call + * @param apiVersion The api version to use + * @param kind The kind of the object + * @return An ObjectOrStatus which contains the Object requested, or a Status about the request. + */ + public ObjectOrStatus merge( + T obj, String path, String apiVersion, String kind) throws ApiException, IOException { + return request(obj.newBuilderForType(), path, "PATCH", obj, apiVersion, kind); + } /** * Delete a kubernetes API object using protocol buffer encoding. From ed9805ca3acccd0f13523a2b5cba2c615383ec59 Mon Sep 17 00:00:00 2001 From: TwinProduction Date: Fri, 2 Nov 2018 10:34:56 -0400 Subject: [PATCH 2/3] Add merge in ProtoClient --- .../java/io/kubernetes/client/ProtoClient.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/util/src/main/java/io/kubernetes/client/ProtoClient.java b/util/src/main/java/io/kubernetes/client/ProtoClient.java index 780ae423f3..d985864594 100644 --- a/util/src/main/java/io/kubernetes/client/ProtoClient.java +++ b/util/src/main/java/io/kubernetes/client/ProtoClient.java @@ -131,6 +131,20 @@ public ObjectOrStatus update( T obj, String path, String apiVersion, String kind) throws ApiException, IOException { return request(obj.newBuilderForType(), path, "PUT", obj, apiVersion, kind); } + + /** + * Merge a Kubernetes API object using protocol buffer encoding. Performs a PATCH + * + * @param obj The object to merge + * @param path The URL path to call + * @param apiVersion The api version to use + * @param kind The kind of the object + * @return An ObjectOrStatus which contains the Object requested, or a Status about the request. + */ + public ObjectOrStatus merge( + T obj, String path, String apiVersion, String kind) throws ApiException, IOException { + return request(obj.newBuilderForType(), path, "PATCH", obj, apiVersion, kind); + } /** * Delete a kubernetes API object using protocol buffer encoding. From 5d07d604a82343026e6cb06641a1fa043568d526 Mon Sep 17 00:00:00 2001 From: TwinProduction Date: Sat, 3 Nov 2018 23:38:34 -0400 Subject: [PATCH 3/3] Fixed format --- util/src/main/java/io/kubernetes/client/ProtoClient.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/src/main/java/io/kubernetes/client/ProtoClient.java b/util/src/main/java/io/kubernetes/client/ProtoClient.java index d985864594..3d5120b28b 100644 --- a/util/src/main/java/io/kubernetes/client/ProtoClient.java +++ b/util/src/main/java/io/kubernetes/client/ProtoClient.java @@ -131,7 +131,7 @@ public ObjectOrStatus update( T obj, String path, String apiVersion, String kind) throws ApiException, IOException { return request(obj.newBuilderForType(), path, "PUT", obj, apiVersion, kind); } - + /** * Merge a Kubernetes API object using protocol buffer encoding. Performs a PATCH *