File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
util/src/main/java/io/kubernetes/client/util Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change 2424import java .io .IOException ;
2525import java .lang .reflect .Type ;
2626import java .util .Iterator ;
27+ import org .slf4j .Logger ;
28+ import org .slf4j .LoggerFactory ;
2729
2830/**
2931 * Watch class implements watch mechansim of kubernetes. For every list API call with a watch
3436public class Watch <T >
3537 implements Iterable <Watch .Response <T >>, Iterator <Watch .Response <T >>, java .io .Closeable {
3638
39+ private static final Logger log = LoggerFactory .getLogger (Watch .class );
40+
3741 /**
3842 * Response class holds a watch response that has a `type` that can be ADDED, MODIFIED, DELETED
3943 * and ERROR. It also hold the actual target object.
@@ -78,6 +82,11 @@ public static class Response<T> {
7882 */
7983 public static <T > Watch <T > createWatch (ApiClient client , Call call , Type watchType )
8084 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+ }
8190 try {
8291 com .squareup .okhttp .Response response = call .execute ();
8392 if (!response .isSuccessful ()) {
You can’t perform that action at this time.
0 commit comments