bgeng777 commented on a change in pull request #62:
URL: 
https://github.com/apache/flink-kubernetes-operator/pull/62#discussion_r826683535



##########
File path: 
flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/service/FlinkService.java
##########
@@ -129,6 +132,26 @@ public boolean isJobManagerPortReady(Configuration config) 
{
         return false;
     }
 
+    public boolean isJobManagerServing(Configuration config) {
+        try (ClusterClient<String> clusterClient = getClusterClient(config)) {
+            clusterClient.getWebInterfaceURL();
+            URL url =
+                    new URL(
+                            clusterClient.getWebInterfaceURL()
+                                    + 
JobsOverviewHeaders.getInstance().getTargetRestEndpointURL());
+            // TODO: add support for https if necessary
+            HttpURLConnection connection = (HttpURLConnection) 
url.openConnection();
+            connection.setRequestMethod("GET");
+            connection.connect();
+            if (connection.getResponseCode() == HttpURLConnection.HTTP_OK) {
+                return true;
+            }

Review comment:
       Thanks for this catch. I neglect that the `clusterClient.listJobs()` 
will actually send reqesut the same with this raw http blocking call. Have 
updated to use the clusterClient.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@flink.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to