Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@

import static io.fabric8.kubernetes.client.utils.Utils.isNotNullOrEmpty;
import static java.net.HttpURLConnection.HTTP_GONE;
import static java.net.HttpURLConnection.HTTP_OK;

public class WatchConnectionManager<T extends HasMetadata, L extends KubernetesResourceList<T>> implements Watch {

Expand Down Expand Up @@ -193,6 +194,15 @@ public void onFailure(IOException e, Response response) {
return;
}

// We do not expect a 200 in response to the websocket connection. If it occurs, we throw
// an exception and try the watch via a persistent HTTP Get.
if (response != null && response.code() == HTTP_OK) {
queue.add(new KubernetesClientException("Received 200 on websocket",
response.code(), null));
response.body().close();
return;
}

if (response != null) {
// We only need to queue startup failures.
Status status = OperationSupport.createStatus(response);
Expand Down