Skip to content

Commit 26c7a95

Browse files
committed
fixup! Add Watch support
1 parent 593006c commit 26c7a95

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,4 @@ public static void main(String[] args) throws IOException, ApiException{
4141
System.out.printf("%s : %s%n", item.type, item.object.getMetadata().getName());
4242
}
4343
}
44-
}
44+
}

kubernetes/src/main/java/io/kubernetes/client/Watch.java

+6-1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@
2828
*/
2929
public class Watch<T> implements Iterable<Watch.Response<T>> {
3030

31+
/**
32+
* Response class holds a watch response that has a `type` that can be
33+
* ADDED, MODIFIED, DELETED and ERROR. It also hold the actual target
34+
* object.
35+
*/
3136
public static class Response<T> {
3237
@SerializedName("type")
3338
public String type;
@@ -45,7 +50,7 @@ public static class Response<T> {
4550
ResponseBody response;
4651
JSON json;
4752

48-
public Watch(JSON json, ResponseBody body, Type watchType) throws IOException, ApiException {
53+
public Watch(JSON json, ResponseBody body, Type watchType) {
4954
this.response = body;
5055
this.watchType = watchType;
5156
this.json = json;

0 commit comments

Comments
 (0)