Skip to content

Commit cd4108d

Browse files
author
Lewis Headden
committed
Update or remove imports
1 parent af94a84 commit cd4108d

File tree

3 files changed

+23
-47
lines changed

3 files changed

+23
-47
lines changed

util/src/main/java/io/kubernetes/client/Attach.java

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,13 @@
1212
*/
1313
package io.kubernetes.client;
1414

15-
import io.kubernetes.client.Configuration;
1615
import io.kubernetes.client.models.V1Pod;
1716
import io.kubernetes.client.util.WebSockets;
1817
import io.kubernetes.client.util.WebSocketStreamHandler;
1918

20-
import java.io.ByteArrayInputStream;
2119
import java.io.InputStream;
2220
import java.io.IOException;
2321
import java.io.OutputStream;
24-
import java.io.PipedInputStream;
25-
import java.io.PipedOutputStream;
26-
import java.io.Reader;
27-
28-
import org.apache.commons.lang.StringUtils;
2922

3023
public class Attach {
3124
private ApiClient apiClient;
@@ -75,7 +68,7 @@ private String makePath(String namespace, String name, String container, boolean
7568
/**
7669
* Attach to a running AttachResult in a container. If there are multiple containers in the pod, uses
7770
* the first container in the Pod.
78-
*
71+
*
7972
* @param namespace The namespace of the Pod
8073
* @param name The name of the Pod
8174
* @param stdin If true, pass a stdin stream into the container
@@ -87,9 +80,9 @@ public AttachResult attach(String namespace, String name, boolean stdin) throws
8780
/**
8881
* Attach to a running AttachResult in a container. If there are multiple containers in the pod, uses
8982
* the first container in the Pod.
90-
*
83+
*
9184
* @param pod The pod where the command is run.
92-
* @param stdin If true, pass a stdin stream into the container
85+
* @param stdin If true, pass a stdin stream into the container
9386
*/
9487
public AttachResult attach(V1Pod pod, boolean stdin) throws ApiException, IOException {
9588
return attach(pod, stdin, false);
@@ -99,9 +92,9 @@ public AttachResult attach(V1Pod pod, boolean stdin) throws ApiException, IOExce
9992
/**
10093
* Attach to a running AttachResult in a container. If there are multiple containers in the pod, uses
10194
* the first container in the Pod.
102-
*
95+
*
10396
* @param pod The pod where the command is run.
104-
* @param stdin If true, pass a stdin stream into the container
97+
* @param stdin If true, pass a stdin stream into the container
10598
* @param tty If true, stdin is a tty.
10699
*/
107100
public AttachResult attach(V1Pod pod, boolean stdin, boolean tty) throws ApiException, IOException {
@@ -111,7 +104,7 @@ public AttachResult attach(V1Pod pod, boolean stdin, boolean tty) throws ApiExce
111104
/**
112105
* Attach to a running AttachResult in a container. If there are multiple containers in the pod, uses
113106
* the first container in the Pod.
114-
*
107+
*
115108
* @param pod The pod where the command is run.
116109
* @param container The container in the Pod where the command is run.
117110
* @param stdin If true, pass a stdin stream into the container.
@@ -124,7 +117,7 @@ public AttachResult attach(V1Pod pod, String container, boolean stdin, boolean t
124117
/**
125118
* Attach to a running AttachResult in a container. If there are multiple containers in the pod, uses
126119
* the first container in the Pod.
127-
*
120+
*
128121
* @param namespace The namespace of the Pod
129122
* @param name The name of the Pod
130123
* @param container The container in the Pod where the command is run.
@@ -143,9 +136,9 @@ public AttachResult attach(String namespace, String name, String container, bool
143136

144137
/**
145138
* AttachResult contains the result of an Attach call, it includes streams for stdout
146-
* stderr and stdin.
139+
* stderr and stdin.
147140
*/
148-
public static class AttachResult implements java.io.Closeable {
141+
public static class AttachResult implements java.io.Closeable {
149142
private WebSocketStreamHandler handler;
150143

151144

util/src/main/java/io/kubernetes/client/Exec.java

Lines changed: 14 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,14 @@
1212
*/
1313
package io.kubernetes.client;
1414

15-
import io.kubernetes.client.Configuration;
1615
import io.kubernetes.client.models.V1Pod;
1716
import io.kubernetes.client.util.WebSocketStreamHandler;
1817
import io.kubernetes.client.util.WebSockets;
18+
import org.apache.commons.lang3.StringUtils;
1919

20-
import java.io.ByteArrayInputStream;
21-
import java.io.Closeable;
2220
import java.io.InputStream;
2321
import java.io.IOException;
2422
import java.io.OutputStream;
25-
import java.io.PipedInputStream;
26-
import java.io.PipedOutputStream;
27-
import java.io.Reader;
28-
29-
import org.apache.commons.lang.StringUtils;
3023

3124
public class Exec {
3225
private ApiClient apiClient;
@@ -70,15 +63,15 @@ private String makePath(String namespace, String name, String[] command, String
7063
"/exec?" +
7164
"stdin=" + stdin +
7265
"&tty=" + tty +
73-
(container != null ? "&container=" + container : "") +
66+
(container != null ? "&container=" + container : "") +
7467
"&command=" + StringUtils.join(command, "&command=");
7568
return path;
7669
}
7770

7871
/**
7972
* Execute a command in a container. If there are multiple containers in the pod, uses
8073
* the first container in the Pod.
81-
*
74+
*
8275
* @param namespace The namespace of the Pod
8376
* @param name The name of the Pod
8477
* @param command The command to run
@@ -91,10 +84,10 @@ public Process exec(String namespace, String name, String[] command, boolean std
9184
/**
9285
* Execute a command in a container. If there are multiple containers in the pod, uses
9386
* the first container in the Pod.
94-
*
87+
*
9588
* @param pod The pod where the command is run.
9689
* @param command The command to run
97-
* @param stdin If true, pass a stdin stream into the container
90+
* @param stdin If true, pass a stdin stream into the container
9891
*/
9992
public Process exec(V1Pod pod, String[] command, boolean stdin) throws ApiException, IOException {
10093
return exec(pod, command, null, stdin, false);
@@ -103,11 +96,11 @@ public Process exec(V1Pod pod, String[] command, boolean stdin) throws ApiExcept
10396
/**
10497
* Execute a command in a container. If there are multiple containers in the pod, uses
10598
* the first container in the Pod.
106-
*
99+
*
107100
* @param namespace The namespace of the Pod
108101
* @param name The name of the Pod
109102
* @param command The command to run
110-
* @param stdin If true, pass a stdin stream into the container
103+
* @param stdin If true, pass a stdin stream into the container
111104
* @param tty If true, stdin is a tty.
112105
*/
113106
public Process exec(String namespace, String name, String[] command, boolean stdin, boolean tty) throws ApiException, IOException {
@@ -117,10 +110,10 @@ public Process exec(String namespace, String name, String[] command, boolean std
117110
/**
118111
* Execute a command in a container. If there are multiple containers in the pod, uses
119112
* the first container in the Pod.
120-
*
113+
*
121114
* @param pod The pod where the command is run.
122115
* @param command The command to run
123-
* @param stdin If true, pass a stdin stream into the container
116+
* @param stdin If true, pass a stdin stream into the container
124117
* @param tty If true, stdin is a tty.
125118
*/
126119
public Process exec(V1Pod pod, String[] command, boolean stdin, boolean tty) throws ApiException, IOException {
@@ -130,7 +123,7 @@ public Process exec(V1Pod pod, String[] command, boolean stdin, boolean tty) thr
130123
/**
131124
* Execute a command in a container. If there are multiple containers in the pod, uses
132125
* the first container in the Pod.
133-
*
126+
*
134127
* @param pod The pod where the command is run.
135128
* @param command The command to run
136129
* @param container The container in the Pod where the command is run.
@@ -144,7 +137,7 @@ public Process exec(V1Pod pod, String[] command, String container, boolean stdin
144137
/**
145138
* Execute a command in a container. If there are multiple containers in the pod, uses
146139
* the first container in the Pod.
147-
*
140+
*
148141
* @param namespace The namespace of the Pod
149142
* @param name The name of the Pod
150143
* @param command The command to run
@@ -166,7 +159,7 @@ private static class ExecProcess extends Process {
166159
WebSocketStreamHandler streamHandler;
167160
private int statusCode;
168161

169-
162+
170163
public ExecProcess(WebSocketStreamHandler handler) throws IOException {
171164
this.streamHandler = handler;
172165
this.statusCode = -1;
@@ -194,13 +187,13 @@ public int waitFor() throws InterruptedException {
194187
}
195188
return statusCode;
196189
}
197-
190+
198191
public int exitValue() {
199192
return statusCode;
200193
}
201194

202195
public void destroy() {
203196
streamHandler.close();
204197
}
205-
}
198+
}
206199
}

util/src/main/java/io/kubernetes/client/PodLogs.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,11 @@
1212
*/
1313
package io.kubernetes.client;
1414

15-
import io.kubernetes.client.Configuration;
1615
import io.kubernetes.client.apis.CoreV1Api;
1716
import io.kubernetes.client.models.V1Pod;
18-
import io.kubernetes.client.util.WebSockets;
19-
import io.kubernetes.client.util.WebSocketStreamHandler;
2017

21-
import java.io.ByteArrayInputStream;
2218
import java.io.InputStream;
2319
import java.io.IOException;
24-
import java.io.OutputStream;
25-
import java.io.PipedInputStream;
26-
import java.io.PipedOutputStream;
27-
import java.io.Reader;
28-
29-
import org.apache.commons.lang.StringUtils;
3020

3121
import com.squareup.okhttp.Call;
3222
import com.squareup.okhttp.Response;

0 commit comments

Comments
 (0)