|
|
|
@@ -89,10 +89,12 @@ public class JupyterServiceImpl implements JupyterService { |
|
|
|
String modelPath = (String) model.get("path"); |
|
|
|
|
|
|
|
LoginUser loginUser = SecurityUtils.getLoginUser(); |
|
|
|
String podName = loginUser.getUsername().toLowerCase() + "-editor-pod"; |
|
|
|
//手动构造pod名称 |
|
|
|
String podName = loginUser.getUsername().toLowerCase() + "-" + "-editor-pod" + id; |
|
|
|
String pvcName = loginUser.getUsername().toLowerCase() + "-editor-pvc"; |
|
|
|
V1PersistentVolumeClaim pvc = k8sClientUtil.createPvc(namespace, pvcName, storage, storageClassName); |
|
|
|
|
|
|
|
|
|
|
|
//TODO 设置镜像可配置,这里先用默认镜像启动pod |
|
|
|
|
|
|
|
// 调用修改后的 createPod 方法,传入额外的参数 |
|
|
|
@@ -110,7 +112,8 @@ public class JupyterServiceImpl implements JupyterService { |
|
|
|
} |
|
|
|
|
|
|
|
LoginUser loginUser = SecurityUtils.getLoginUser(); |
|
|
|
String podName = loginUser.getUsername().toLowerCase() + "-editor-pod"; |
|
|
|
//手动构造pod名称 |
|
|
|
String podName = loginUser.getUsername().toLowerCase() + "-" + devEnvironment.getName() +"-editor-pod" + id; |
|
|
|
//得到pod |
|
|
|
V1Pod pod = k8sClientUtil.getNSPodList(namespace, podName); |
|
|
|
if(pod == null){ |
|
|
|
@@ -119,6 +122,7 @@ public class JupyterServiceImpl implements JupyterService { |
|
|
|
// 使用 Kubernetes API 删除 Pod |
|
|
|
String deleteResult = k8sClientUtil.deletePod(podName, namespace); |
|
|
|
|
|
|
|
|
|
|
|
return deleteResult + ",编辑器已停止"; |
|
|
|
} |
|
|
|
|
|
|
|
|