diff --git a/CHANGELOG.md b/CHANGELOG.md index cddedce94a5..cf8f32a612f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ * Fix #2748: Pass custom headers in kubernetes-client to watch api by modify WatchConnectionManager #### Improvements +* Fix #2717: Remove edit() methods from RawCustomResourceOperationsImpl taking InputStream arguments #### Dependency Upgrade * update Tekton Triggers model to v0.11.1 diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/RawCustomResourceOperationsImpl.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/RawCustomResourceOperationsImpl.java index 2c3035070ea..bcddfbc2b8d 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/RawCustomResourceOperationsImpl.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/RawCustomResourceOperationsImpl.java @@ -286,31 +286,6 @@ public Map edit(String namespace, String name, String objectAsSt return validateAndSubmitRequest(namespace, name, objectAsString, HttpCallMethod.PUT); } - /** - * Edit a custom resource object which is a non-namespaced object. - * - * @param name name of the custom resource - * @param objectAsStream new object as a file input stream - * @return Object as HashMap - * @throws IOException in case of network/serialization failures or failures from Kubernetes API - */ - public Map edit(String name, InputStream objectAsStream) throws IOException { - return validateAndSubmitRequest(null, name, IOHelpers.readFully(objectAsStream), HttpCallMethod.PUT); - } - - /** - * Edit a custom resource object which is a namespaced object. - * - * @param namespace desired namespace - * @param name name of the custom resource - * @param objectAsStream new object as a file input stream - * @return Object as HashMap - * @throws IOException in case of network/serialization failures or failures from Kubernetes API - */ - public Map edit(String namespace, String name, InputStream objectAsStream) throws IOException { - return validateAndSubmitRequest(namespace, name, IOHelpers.readFully(objectAsStream), HttpCallMethod.PUT); - } - /** * Update status related to a CustomResource, this method does a PUT request on /status endpoint related * to the CustomResource diff --git a/kubernetes-itests/src/test/java/io/fabric8/kubernetes/RawCustomResourceIT.java b/kubernetes-itests/src/test/java/io/fabric8/kubernetes/RawCustomResourceIT.java index cd53ea3c3d7..f1afc60b8fe 100644 --- a/kubernetes-itests/src/test/java/io/fabric8/kubernetes/RawCustomResourceIT.java +++ b/kubernetes-itests/src/test/java/io/fabric8/kubernetes/RawCustomResourceIT.java @@ -151,7 +151,7 @@ public void testCrudUsingMap() throws IOException { } @Test - public void testCrudUsingInputStream() throws IOException { + public void testCreateReadDeleteUsingInputStream() throws IOException { // Create String name = "hippo"; InputStream hippoInputStream = getClass().getResourceAsStream("/rawcustomresourceit-crud-inputstream.yml"); @@ -162,13 +162,6 @@ public void testCrudUsingInputStream() throws IOException { hippoCr = client.customResource(customResourceDefinitionContext).get(currentNamespace, name); assertAnimal(hippoCr, name, "Hippopotamidae"); - // Update - ((Map)hippoCr.get("spec")).put("image", "river-hippo"); - File updatedHippoManifest = Files.createTempFile("hippo", "yml").toFile(); - FileUtils.writeStringToFile(updatedHippoManifest, Serialization.jsonMapper().writeValueAsString(hippoCr)); - hippoCr = client.customResource(customResourceDefinitionContext).edit(currentNamespace, name, new FileInputStream(updatedHippoManifest)); - assertAnimal(hippoCr, name, "river-hippo"); - // Delete Map deletionStatusMap = client.customResource(customResourceDefinitionContext).delete(currentNamespace, name); assertDeletionStatus(deletionStatusMap, "Success");