You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@submarine.apache.org by GitBox <gi...@apache.org> on 2020/04/16 05:45:09 UTC

[GitHub] [submarine] JohnTing commented on a change in pull request #263: SUBMARINE-442. Support get job's log in submarine-server REST API

JohnTing commented on a change in pull request #263: SUBMARINE-442. Support get job's log in submarine-server REST API
URL: https://github.com/apache/submarine/pull/263#discussion_r409295706
 
 

 ##########
 File path: submarine-server/server-submitter/submitter-k8s/src/main/java/org/apache/submarine/server/submitter/k8s/K8sJobSubmitter.java
 ##########
 @@ -186,6 +197,80 @@ private Job parseResponseObject(Object object, ParseOp op) throws SubmarineRunti
     throw new SubmarineRuntimeException(500, "K8s Submitter parse upstream response failed.");
   }
 
+  public String getLog(final Job job) {
+    if (job == null) {
+      return null;
+    }
+    final CoreV1Api COREV1_API = new CoreV1Api(client);
+
+    try {
+      final V1PodList podList = COREV1_API.listNamespacedPod(
+          job.getSpec().getSubmitterSpec().getNamespace(),
+          "false", null, null,
+          getJobLabelSelector(job), null, null,
+          null, null);
+
+      final V1Pod pod = podList.getItems().get(0);
 
 Review comment:
   Ok, I will modify it

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services