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 45f1f6f SUBMARINE-1004 NullPointerException could be thrown in
NotebookSpecParser.java
45f1f6f is described below
commit 45f1f6f992936b2e681235c5ee7e18de080a9ad0
Author: 0yukali0 <[email protected]>
AuthorDate: Mon Sep 13 07:26:19 2021 +0800
SUBMARINE-1004 NullPointerException could be thrown in
NotebookSpecParser.java
### 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
Author: 0yukali0 <[email protected]>
Author: 0yukali0 <[email protected]>
Signed-off-by: Kevin <[email protected]>
Closes #746 from 0yukali0/SUBMARINE-1004 and squashes the following commits:
d53551e3 [0yukali0] Update
submarine-server/server-submitter/submitter-k8s/src/main/java/org/apache/submarine/server/submitter/k8s/parser/NotebookSpecParser.java
2e2a093d [0yukali0] SUBMARINE-1004 NullPointerException could be thrown in
NotebookSpecParser.java
---
.../submarine/server/submitter/k8s/parser/NotebookSpecParser.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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 c5f588c..b6ac276 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
@@ -100,7 +100,7 @@ public class NotebookSpecParser {
container.addEnvItem(submarineServerPortEnv);
// Environment
- if (getEnvironment(notebookSpec) != null) {
+ if (getEnvironment(notebookSpec) != null &&
getEnvironment(notebookSpec).getEnvironmentSpec() != null) {
EnvironmentSpec environmentSpec =
getEnvironment(notebookSpec).getEnvironmentSpec();
String baseImage = environmentSpec.getDockerImage();
KernelSpec kernel = environmentSpec.getKernelSpec();
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]