From 2ddfb77be57d45668f5f791e06feec4601ba0ba2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=A5=BF=E5=A4=A7=E9=94=90?= <1070211640@qq.com> Date: Tue, 18 Jun 2024 09:41:16 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E6=96=B0=E5=A2=9Ejupyter=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E7=8A=B6=E6=80=81=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ruoyi/platform/service/impl/JupyterServiceImpl.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/JupyterServiceImpl.java b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/JupyterServiceImpl.java index cdb87318..49c8eecb 100644 --- a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/JupyterServiceImpl.java +++ b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/JupyterServiceImpl.java @@ -90,7 +90,7 @@ public class JupyterServiceImpl implements JupyterService { LoginUser loginUser = SecurityUtils.getLoginUser(); //手动构造pod名称 - String podName = loginUser.getUsername().toLowerCase() + "-" + "-editor-pod" + id; + String podName = loginUser.getUsername().toLowerCase() + "-" + devEnvironment.getName() +"-editor-pod" + "-" + id; String pvcName = loginUser.getUsername().toLowerCase() + "-editor-pvc"; V1PersistentVolumeClaim pvc = k8sClientUtil.createPvc(namespace, pvcName, storage, storageClassName); @@ -113,7 +113,7 @@ public class JupyterServiceImpl implements JupyterService { LoginUser loginUser = SecurityUtils.getLoginUser(); //手动构造pod名称 - String podName = loginUser.getUsername().toLowerCase() + "-" + devEnvironment.getName() +"-editor-pod" + id; + String podName = loginUser.getUsername().toLowerCase() + "-" + devEnvironment.getName() +"-editor-pod" + "-" + id; //得到pod V1Pod pod = k8sClientUtil.getNSPodList(namespace, podName); if(pod == null){ @@ -122,7 +122,6 @@ public class JupyterServiceImpl implements JupyterService { // 使用 Kubernetes API 删除 Pod String deleteResult = k8sClientUtil.deletePod(podName, namespace); - return deleteResult + ",编辑器已停止"; } @@ -149,6 +148,8 @@ public class JupyterServiceImpl implements JupyterService { } catch (Exception e) { return JupyterStatusVo; + + } String url = redisService.getCacheObject(podName); JupyterStatusVo.setStatus(status);