This is an automated email from the ASF dual-hosted git repository.

pingsutw pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/submarine.git


The following commit(s) were added to refs/heads/master by this push:
     new ee673b5  SUBMARINE-1202. fix 404 issue and avoiding NotbookHandler 
receive the events of previous notebook with same name
ee673b5 is described below

commit ee673b5ba758024629e8b861c58881dd09e93abe
Author: FatalLin <[email protected]>
AuthorDate: Tue Mar 1 13:41:51 2022 +0800

    SUBMARINE-1202. fix 404 issue and avoiding NotbookHandler receive the 
events of previous notebook with same name
    
    ### What is this PR for?
    fix the issue of notebook routing not found and receive previous events 
which causes crash of agent
    ### What type of PR is it?
    Bug fix
    
    ### Todos
    * [ ] - Task
    
    ### What is the Jira issue?
    https://issues.apache.org/jira/browse/SUBMARINE-1202
    
    ### How should this be tested?
    should pass existed tests.
    ### Screenshots
    ![Screen Shot 2022-03-01 at 1 39 01 
PM](https://user-images.githubusercontent.com/5687317/156112085-c5ed9a11-917b-4bd7-9de0-136e22122a84.png)
    ![Screen Shot 2022-03-01 at 1 40 09 
PM](https://user-images.githubusercontent.com/5687317/156112091-a3164cc6-5ad2-42f9-9360-3d1310f3f14e.png)
    
    ### Questions:
    * Do the license files need updating? No
    * Are there breaking changes for older versions? No
    * Does this need new documentation? No
    
    Author: FatalLin <[email protected]>
    
    Signed-off-by: Kevin <[email protected]>
    
    Closes #891 from FatalLin/SUBMARINE-1202 and squashes the following commits:
    
    d604d674 [FatalLin] fix 404 issue and avoiding NotbookHandler recevive the 
events of previous notebook with same name
---
 .../apache/submarine/server/k8s/agent/handler/NotebookHandler.java  | 6 +++---
 .../submarine/server/submitter/k8s/parser/NotebookSpecParser.java   | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git 
a/submarine-server/server-submitter/submarine-k8s-agent/src/main/java/org/apache/submarine/server/k8s/agent/handler/NotebookHandler.java
 
b/submarine-server/server-submitter/submarine-k8s-agent/src/main/java/org/apache/submarine/server/k8s/agent/handler/NotebookHandler.java
index 79611bf..6d43a5a 100644
--- 
a/submarine-server/server-submitter/submarine-k8s-agent/src/main/java/org/apache/submarine/server/k8s/agent/handler/NotebookHandler.java
+++ 
b/submarine-server/server-submitter/submarine-k8s-agent/src/main/java/org/apache/submarine/server/k8s/agent/handler/NotebookHandler.java
@@ -52,7 +52,7 @@ public class NotebookHandler extends CustomResourceHandler {
   private GenericKubernetesApi<CoreV1Event, CoreV1EventList> eventClient;
   private GenericKubernetesApi<NotebookCR, NotebookCRList> notebookCRClient;
 
-  private String podName;
+  private String uid;
   public NotebookHandler() throws IOException {
     super();
   }
@@ -86,10 +86,10 @@ public class NotebookHandler extends CustomResourceHandler {
       listOptions.setLabelSelector(podLabelSelector);
       V1PodList podList = podClient.list(namespace, 
listOptions).throwsApiException().getObject();
 
-      this.podName = podList.getItems().get(0).getMetadata().getName();
+      this.uid = podList.getItems().get(podList.getItems().size() - 
1).getMetadata().getUid();
 
       listOptions = new ListOptions();
-      String fieldSelector = String.format("involvedObject.name=%s", 
this.podName);
+      String fieldSelector = String.format("involvedObject.uid=%s", this.uid);
       listOptions.setFieldSelector(fieldSelector);
       watcher = eventClient.watch(namespace, listOptions);
 
diff --git 
a/submarine-server/server-submitter/submitter-k8s/src/main/java/org/apache/submarine/server/submitter/k8s/parser/NotebookSpecParser.java
 
b/submarine-server/server-submitter/submitter-k8s/src/main/java/org/apache/submarine/server/submitter/k8s/parser/NotebookSpecParser.java
index 3a79f57..2e5a79b 100644
--- 
a/submarine-server/server-submitter/submitter-k8s/src/main/java/org/apache/submarine/server/submitter/k8s/parser/NotebookSpecParser.java
+++ 
b/submarine-server/server-submitter/submitter-k8s/src/main/java/org/apache/submarine/server/submitter/k8s/parser/NotebookSpecParser.java
@@ -325,6 +325,6 @@ public class NotebookSpecParser {
     
     agentContainer.env(envVarList);
     
-    containers.add(0, agentContainer);    
+    containers.add(agentContainer);    
   }
 }

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to