|
|
|
@@ -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); |
|
|
|
|