Browse Source

优化

dev-credits
chenzhihang 10 months ago
parent
commit
8f38bb39f3
1 changed files with 3 additions and 5 deletions
  1. +3
    -5
      ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/JupyterServiceImpl.java

+ 3
- 5
ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/JupyterServiceImpl.java View File

@@ -97,9 +97,8 @@ public class JupyterServiceImpl implements JupyterService {
// String modelPath = "argo-workflow" + "/" + model.get("path"); // String modelPath = "argo-workflow" + "/" + model.get("path");
String modelPath = (String) model.get("path"); String modelPath = (String) model.get("path");


LoginUser loginUser = SecurityUtils.getLoginUser();
//构造pod名称 //构造pod名称
String podName = loginUser.getUsername().toLowerCase() + "-editor-pod" + "-" + id;
String podName = devEnvironment.getCreateBy() + "-editor-pod" + "-" + id;
//新建编辑器的pvc //新建编辑器的pvc
// String pvcName = loginUser.getUsername().toLowerCase() + "-editor-pvc"; // String pvcName = loginUser.getUsername().toLowerCase() + "-editor-pvc";
// V1PersistentVolumeClaim pvc = k8sClientUtil.createPvc(namespace, pvcName, storage, storageClassName); // V1PersistentVolumeClaim pvc = k8sClientUtil.createPvc(namespace, pvcName, storage, storageClassName);
@@ -123,10 +122,9 @@ public class JupyterServiceImpl implements JupyterService {
if (devEnvironment == null) { if (devEnvironment == null) {
throw new Exception("开发环境配置不存在"); throw new Exception("开发环境配置不存在");
} }
LoginUser loginUser = SecurityUtils.getLoginUser();
//构造pod和svc名称 //构造pod和svc名称
String podName = loginUser.getUsername().toLowerCase() + "-editor-pod" + "-" + id;
String svcName = loginUser.getUsername().toLowerCase() + "-editor-pod" + "-" + id + "-svc";
String podName = devEnvironment.getCreateBy() + "-editor-pod" + "-" + id;
String svcName = devEnvironment.getCreateBy() + "-editor-pod" + "-" + id + "-svc";
//得到pod //得到pod
V1Pod pod = k8sClientUtil.getNSPodList(namespace, podName); V1Pod pod = k8sClientUtil.getNSPodList(namespace, podName);
if (pod == null) { if (pod == null) {


Loading…
Cancel
Save