Skip to content

Commit ef18af3

Browse files
committed
addressed comments.
1 parent c23df5f commit ef18af3

File tree

2 files changed

+8
-16
lines changed

2 files changed

+8
-16
lines changed

examples/src/main/java/io/kubernetes/client/examples/LogsExample.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
import io.kubernetes.client.ApiClient;
1616
import io.kubernetes.client.ApiException;
1717
import io.kubernetes.client.Configuration;
18-
import io.kubernetes.client.Logs;
18+
import io.kubernetes.client.PodLogs;
1919
import io.kubernetes.client.apis.CoreV1Api;
2020
import io.kubernetes.client.models.V1Pod;
2121
import io.kubernetes.client.models.V1PodList;
@@ -43,7 +43,7 @@ public static void main(String[] args) throws IOException, ApiException, Interru
4343
Configuration.setDefaultApiClient(client);
4444
CoreV1Api coreApi = new CoreV1Api(client);
4545

46-
Logs logs = new Logs();
46+
PodLogs logs = new PodLogs();
4747
V1Pod pod = coreApi.listNamespacedPod("default", "false", null, null, null, null, null, null, null, null).getItems().get(0);
4848

4949
InputStream is = logs.streamNamespacedPodLog(pod);

util/src/main/java/io/kubernetes/client/Logs.java renamed to util/src/main/java/io/kubernetes/client/PodLogs.java

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -34,22 +34,22 @@
3434
/**
3535
* Utility class offering streaming access to Pod logs.
3636
*/
37-
public class Logs {
37+
public class PodLogs {
3838
private ApiClient apiClient;
3939
private CoreV1Api coreClient;
4040

4141
/**
42-
* Simple Logs API constructor, uses default configuration
42+
* Simple PodLogs API constructor, uses default configuration
4343
*/
44-
public Logs() {
44+
public PodLogs() {
4545
this(Configuration.getDefaultApiClient());
4646
}
4747

4848
/**
49-
* Logs API Constructor
49+
* PodLogs API Constructor
5050
* @param apiClient The api client to use.
5151
*/
52-
public Logs(ApiClient apiClient) {
52+
public PodLogs(ApiClient apiClient) {
5353
this.apiClient = apiClient;
5454
this.coreClient = new CoreV1Api(apiClient);
5555
}
@@ -62,14 +62,6 @@ public ApiClient getApiClient() {
6262
return apiClient;
6363
}
6464

65-
/**
66-
* Set the API client for subsequent Logs operations.
67-
* @param apiClient The new API client to use.
68-
*/
69-
public void setApiClient(ApiClient apiClient) {
70-
this.apiClient = apiClient;
71-
}
72-
7365
public InputStream streamNamespacedPodLog(V1Pod pod) throws ApiException, IOException {
7466
return streamNamespacedPodLog(pod.getMetadata().getNamespace(), pod.getMetadata().getName(),
7567
pod.getSpec().getContainers().get(0).getName());
@@ -91,4 +83,4 @@ public InputStream streamNamespacedPodLog(String namespace, String name, String
9183
}
9284
return response.body().byteStream();
9385
}
94-
}
86+
}

0 commit comments

Comments
 (0)