|
45 | 45 |
|
46 | 46 | import hudson.AbortException;
|
47 | 47 | import io.fabric8.kubernetes.api.model.Container;
|
48 |
| -import org.apache.commons.io.output.NullOutputStream; |
49 | 48 | import org.apache.commons.io.output.TeeOutputStream;
|
50 | 49 | import org.csanchez.jenkins.plugins.kubernetes.ContainerTemplate;
|
51 | 50 | import org.csanchez.jenkins.plugins.kubernetes.KubernetesSlave;
|
|
64 | 63 | import io.fabric8.kubernetes.client.dsl.ExecListener;
|
65 | 64 | import io.fabric8.kubernetes.client.dsl.ExecWatch;
|
66 | 65 | import io.fabric8.kubernetes.client.dsl.Execable;
|
67 |
| -import okhttp3.Response; |
68 | 66 |
|
69 | 67 | import static org.csanchez.jenkins.plugins.kubernetes.pipeline.Constants.EXIT;
|
70 | 68 |
|
@@ -427,19 +425,10 @@ public void onClose(int i, String s) {
|
427 | 425 | try {
|
428 | 426 | watch = execable.exec(sh);
|
429 | 427 | } catch (KubernetesClientException e) {
|
430 |
| - if (e.getCause() instanceof InterruptedException) { |
431 |
| - throw new IOException( |
432 |
| - "Interrupted while starting websocket connection, you should increase the Max connections to Kubernetes API", |
433 |
| - e); |
434 |
| - } else { |
435 |
| - throw e; |
436 |
| - } |
437 |
| - } catch (RejectedExecutionException e) { |
438 |
| - throw new IOException( |
439 |
| - "Connection was rejected, you should increase the Max connections to Kubernetes API", e); |
| 428 | + throw new IOException("Unable to perform kubernetes execution, you should consider increasing the Max connections to Kubernetes API", e); |
440 | 429 | }
|
441 | 430 |
|
442 |
| - boolean hasStarted = false; |
| 431 | + boolean hasStarted; |
443 | 432 | try {
|
444 | 433 | // prevent a wait forever if the connection is closed as the listener would never be called
|
445 | 434 | hasStarted = started.await(WEBSOCKET_CONNECTION_TIMEOUT, TimeUnit.SECONDS);
|
|
0 commit comments