File tree 1 file changed +9
-0
lines changed
util/src/main/java/io/kubernetes/client/util
1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change 24
24
import java .io .IOException ;
25
25
import java .lang .reflect .Type ;
26
26
import java .util .Iterator ;
27
+ import org .slf4j .Logger ;
28
+ import org .slf4j .LoggerFactory ;
27
29
28
30
/**
29
31
* Watch class implements watch mechansim of kubernetes. For every list API call with a watch
34
36
public class Watch <T >
35
37
implements Iterable <Watch .Response <T >>, Iterator <Watch .Response <T >>, java .io .Closeable {
36
38
39
+ private static final Logger log = LoggerFactory .getLogger (Watch .class );
40
+
37
41
/**
38
42
* Response class holds a watch response that has a `type` that can be ADDED, MODIFIED, DELETED
39
43
* and ERROR. It also hold the actual target object.
@@ -78,6 +82,11 @@ public static class Response<T> {
78
82
*/
79
83
public static <T > Watch <T > createWatch (ApiClient client , Call call , Type watchType )
80
84
throws ApiException {
85
+ if (client .isDebugging ()) {
86
+ log .warn (
87
+ "Watch is (for now) incompatible with debugging mode active. Watches will not return data until the watch connection terminates" );
88
+ throw new ApiException ("Watch is incompatible with debugging mode active." );
89
+ }
81
90
try {
82
91
com .squareup .okhttp .Response response = call .execute ();
83
92
if (!response .isSuccessful ()) {
You can’t perform that action at this time.
0 commit comments