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 2021/09/12 16:52:21 UTC

[GitHub] [submarine] 0yukali0 opened a new pull request #746: SUBMARINE-1004 NullPointerException could be thrown in NotebookSpecParser.java

0yukali0 opened a new pull request #746:
URL: https://github.com/apache/submarine/pull/746


   ### What is this PR for?
   avoid NullPointerException could be thrown from getEnvironmentSpec() 
   
   ### What type of PR is it?
   [Bug Fix]
   
   ### Todos
   * [ ] - Task
   
   ### What is the Jira issue?
   https://issues.apache.org/jira/browse/SUBMARINE-1004
   
   ### How should this be tested?
   
   ### Screenshots (if appropriate)
   
   ### Questions:
   * Do the license files need updating? Yes/No
   * Are there breaking changes for older versions? Yes/No
   * Does this need new documentation? Yes/No
   


-- 
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-unsubscribe@submarine.apache.org

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



[GitHub] [submarine] 0yukali0 commented on pull request #746: SUBMARINE-1004 NullPointerException could be thrown in NotebookSpecParser.java

Posted by GitBox <gi...@apache.org>.
0yukali0 commented on pull request #746:
URL: https://github.com/apache/submarine/pull/746#issuecomment-917731782


   Hi @pingsutw.
   Thank for review.


-- 
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-unsubscribe@submarine.apache.org

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



[GitHub] [submarine] pingsutw commented on a change in pull request #746: SUBMARINE-1004 NullPointerException could be thrown in NotebookSpecParser.java

Posted by GitBox <gi...@apache.org>.
pingsutw commented on a change in pull request #746:
URL: https://github.com/apache/submarine/pull/746#discussion_r706870166



##########
File path: submarine-server/server-submitter/submitter-k8s/src/main/java/org/apache/submarine/server/submitter/k8s/parser/NotebookSpecParser.java
##########
@@ -100,7 +100,16 @@ private static V1PodTemplateSpec parseTemplateSpec(NotebookSpec notebookSpec) {
     container.addEnvItem(submarineServerPortEnv);
 
     // Environment
+    boolean environmentsExist = true;
+    boolean environmentsSpecExist = true;
     if (getEnvironment(notebookSpec) != null) {
+      environmentsExist = false;
+      environmentsSpecExist = false;
+    } else if (getEnvironment(notebookSpec).getEnvironmentSpec() != null) {
+      environmentsSpecExist = false;
+    }
+
+    if (environmentsExist && environmentsSpecExist) {

Review comment:
       ```suggestion
       if (getEnvironment(notebookSpec) != null && getEnvironment(notebookSpec).getEnvironmentSpec() != null) {
   ```




-- 
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-unsubscribe@submarine.apache.org

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



[GitHub] [submarine] asfgit closed pull request #746: SUBMARINE-1004 NullPointerException could be thrown in NotebookSpecParser.java

Posted by GitBox <gi...@apache.org>.
asfgit closed pull request #746:
URL: https://github.com/apache/submarine/pull/746


   


-- 
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-unsubscribe@submarine.apache.org

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



[GitHub] [submarine] pingsutw commented on a change in pull request #746: SUBMARINE-1004 NullPointerException could be thrown in NotebookSpecParser.java

Posted by GitBox <gi...@apache.org>.
pingsutw commented on a change in pull request #746:
URL: https://github.com/apache/submarine/pull/746#discussion_r706870300



##########
File path: submarine-server/server-submitter/submitter-k8s/src/main/java/org/apache/submarine/server/submitter/k8s/parser/NotebookSpecParser.java
##########
@@ -100,7 +100,16 @@ private static V1PodTemplateSpec parseTemplateSpec(NotebookSpec notebookSpec) {
     container.addEnvItem(submarineServerPortEnv);
 
     // Environment
+    boolean environmentsExist = true;
+    boolean environmentsSpecExist = true;
     if (getEnvironment(notebookSpec) != null) {
+      environmentsExist = false;
+      environmentsSpecExist = false;
+    } else if (getEnvironment(notebookSpec).getEnvironmentSpec() != null) {
+      environmentsSpecExist = false;
+    }
+
+    if (environmentsExist && environmentsSpecExist) {

Review comment:
       It will be more concise




-- 
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-unsubscribe@submarine.apache.org

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



[GitHub] [submarine] 0yukali0 edited a comment on pull request #746: SUBMARINE-1004 NullPointerException could be thrown in NotebookSpecParser.java

Posted by GitBox <gi...@apache.org>.
0yukali0 edited a comment on pull request #746:
URL: https://github.com/apache/submarine/pull/746#issuecomment-917731782


   Hi @pingsutw.
   Thanks for review.


-- 
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-unsubscribe@submarine.apache.org

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