From 725ccd8e8fe2195f24ab522b21107532f2beee18 Mon Sep 17 00:00:00 2001 From: Ioannis Canellos Date: Tue, 26 Mar 2019 22:04:38 +0200 Subject: [PATCH] fix: Apply feedback and add changelog. --- CHANGELOG.md | 1 + .../client/dsl/internal/PodOperationsImpl.java | 9 ++++----- .../src/test/java/io/fabric8/kubernetes/PodIT.java | 1 - 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8d543371810..9d281287e94 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ Improvements * Fix #1425: Preserve labels and fields when using CRD's withResourceVersion() + * Introduce file and dir read / copy from pods Dependency Upgrade * Upgrade Sundrio to 0.16.5 diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/PodOperationsImpl.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/PodOperationsImpl.java index 0c84d863c44..fde67cdd9c5 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/PodOperationsImpl.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/PodOperationsImpl.java @@ -16,7 +16,6 @@ package io.fabric8.kubernetes.client.dsl.internal; import java.io.File; -import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; @@ -331,12 +330,12 @@ public InputStream read() { } } - private InputStream readFile(String source) throws Exception { + private InputStream readFile(String source) { //Let's wrap the code to a callable inner class to avoid NoClassDef when loading this class. try { return new Callable() { @Override - public InputStream call() throws Exception { + public InputStream call() { try { PipedOutputStream out = new PipedOutputStream(); PipedInputStream in = new PipedInputStream(out, 1024); @@ -374,8 +373,8 @@ public void onClose(int code, String reason) { // // - // The copy and read utilities below have been inspired by Brendan Burns copy utilities on the offical kubernetes-client. - // More specifically: https://github.com/fabric8io/kubernetes-client/pull/1444 + // The copy and read utilities below have been inspired by Brendan Burns copy utilities on the official kubernetes-client. + // More specifically: https://github.com/kubernetes-client/java/pull/375 // private void copyFile(String source, File target) { diff --git a/kubernetes-itests/src/test/java/io/fabric8/kubernetes/PodIT.java b/kubernetes-itests/src/test/java/io/fabric8/kubernetes/PodIT.java index beaaa62a2cf..abfccd8ed98 100644 --- a/kubernetes-itests/src/test/java/io/fabric8/kubernetes/PodIT.java +++ b/kubernetes-itests/src/test/java/io/fabric8/kubernetes/PodIT.java @@ -54,7 +54,6 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.awaitility.Awaitility.await; import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; @RunWith(ArquillianConditionalRunner.class)