You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by ke...@apache.org on 2022/10/27 05:56:30 UTC
[dolphinscheduler] branch 3.1.1-prepare updated: [Fix-12356][k8s] fix the null exception when submitting k8s task plugin (#12358)
This is an automated email from the ASF dual-hosted git repository.
kerwin pushed a commit to branch 3.1.1-prepare
in repository https://gitbox.apache.org/repos/asf/dolphinscheduler.git
The following commit(s) were added to refs/heads/3.1.1-prepare by this push:
new 1e62855fa9 [Fix-12356][k8s] fix the null exception when submitting k8s task plugin (#12358)
1e62855fa9 is described below
commit 1e62855fa9ea74a81217fb73208313b329b6d66b
Author: rickchengx <38...@users.noreply.github.com>
AuthorDate: Wed Oct 19 09:49:56 2022 +0800
[Fix-12356][k8s] fix the null exception when submitting k8s task plugin (#12358)
---
.../service/process/ProcessServiceImpl.java | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessServiceImpl.java b/dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessServiceImpl.java
index ceee7e757d..9ce8856eed 100644
--- a/dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessServiceImpl.java
+++ b/dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessServiceImpl.java
@@ -42,6 +42,7 @@ import org.apache.dolphinscheduler.common.utils.CodeGenerateUtils;
import org.apache.dolphinscheduler.common.utils.CodeGenerateUtils.CodeGenerateException;
import org.apache.dolphinscheduler.common.utils.DateUtils;
import org.apache.dolphinscheduler.common.utils.JSONUtils;
+import org.apache.dolphinscheduler.dao.entity.Cluster;
import org.apache.dolphinscheduler.dao.entity.Command;
import org.apache.dolphinscheduler.dao.entity.DagData;
import org.apache.dolphinscheduler.dao.entity.DataSource;
@@ -54,7 +55,6 @@ import org.apache.dolphinscheduler.dao.entity.DqRuleInputEntry;
import org.apache.dolphinscheduler.dao.entity.DqTaskStatisticsValue;
import org.apache.dolphinscheduler.dao.entity.Environment;
import org.apache.dolphinscheduler.dao.entity.ErrorCommand;
-import org.apache.dolphinscheduler.dao.entity.K8s;
import org.apache.dolphinscheduler.dao.entity.ProcessDefinition;
import org.apache.dolphinscheduler.dao.entity.ProcessDefinitionLog;
import org.apache.dolphinscheduler.dao.entity.ProcessInstance;
@@ -73,6 +73,7 @@ import org.apache.dolphinscheduler.dao.entity.TaskInstance;
import org.apache.dolphinscheduler.dao.entity.Tenant;
import org.apache.dolphinscheduler.dao.entity.UdfFunc;
import org.apache.dolphinscheduler.dao.entity.User;
+import org.apache.dolphinscheduler.dao.mapper.ClusterMapper;
import org.apache.dolphinscheduler.dao.mapper.CommandMapper;
import org.apache.dolphinscheduler.dao.mapper.DataSourceMapper;
import org.apache.dolphinscheduler.dao.mapper.DqComparisonTypeMapper;
@@ -83,7 +84,6 @@ import org.apache.dolphinscheduler.dao.mapper.DqRuleMapper;
import org.apache.dolphinscheduler.dao.mapper.DqTaskStatisticsValueMapper;
import org.apache.dolphinscheduler.dao.mapper.EnvironmentMapper;
import org.apache.dolphinscheduler.dao.mapper.ErrorCommandMapper;
-import org.apache.dolphinscheduler.dao.mapper.K8sMapper;
import org.apache.dolphinscheduler.dao.mapper.ProcessDefinitionLogMapper;
import org.apache.dolphinscheduler.dao.mapper.ProcessDefinitionMapper;
import org.apache.dolphinscheduler.dao.mapper.ProcessInstanceMapMapper;
@@ -272,7 +272,7 @@ public class ProcessServiceImpl implements ProcessService {
private TaskPluginManager taskPluginManager;
@Autowired
- private K8sMapper k8sMapper;
+ private ClusterMapper clusterMapper;
@Autowired
private CuringParamsService curingGlobalParamsService;
@@ -3139,10 +3139,11 @@ public class ProcessServiceImpl implements ProcessService {
if (Strings.isNullOrEmpty(clusterName)) {
return null;
}
- QueryWrapper<K8s> nodeWrapper = new QueryWrapper<>();
- nodeWrapper.eq("k8s_name", clusterName);
- K8s k8s = k8sMapper.selectOne(nodeWrapper);
- return k8s.getK8sConfig();
+
+ QueryWrapper<Cluster> nodeWrapper = new QueryWrapper<>();
+ nodeWrapper.eq("name", clusterName);
+ Cluster cluster = clusterMapper.selectOne(nodeWrapper);
+ return cluster == null ? null : cluster.getConfig();
}
@Override