Browse Source

修改联网BUG

pull/30/head
fanshuai 1 year ago
parent
commit
6619f4082a
1 changed files with 2 additions and 6 deletions
  1. +2
    -6
      ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/ImageServiceImpl.java

+ 2
- 6
ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/ImageServiceImpl.java View File

@@ -263,7 +263,7 @@ public class ImageServiceImpl implements ImageService {
V1Pod pod = k8sClientUtil.getNSPodList(serviceNS, deploymentName); V1Pod pod = k8sClientUtil.getNSPodList(serviceNS, deploymentName);
if (pod == null) { if (pod == null) {
String podName = deploymentName+"-"+ DateUtils.formatYMD10(new Date()); String podName = deploymentName+"-"+ DateUtils.formatYMD10(new Date());
pod = createPod(serviceNS, podName);
pod = k8sClientUtil.createPodWithEnv(podName,serviceNS,proxyUrl,mountPath,pvcName,image);
} }
String loginCmd = "docker login -u " + harborUser +" -p "+harborpassword+" "+harborUrl; String loginCmd = "docker login -u " + harborUser +" -p "+harborpassword+" "+harborUrl;
// 执行命令 docker login -u admin -p Harbor12345 172.20.32.187 // 执行命令 docker login -u admin -p Harbor12345 172.20.32.187
@@ -305,7 +305,7 @@ public class ImageServiceImpl implements ImageService {
V1Pod pod = k8sClientUtil.getNSPodList(serviceNS, deploymentName); V1Pod pod = k8sClientUtil.getNSPodList(serviceNS, deploymentName);
if (pod == null) { if (pod == null) {
String podName = deploymentName+"-"+ DateUtils.formatYMD10(new Date()); String podName = deploymentName+"-"+ DateUtils.formatYMD10(new Date());
pod = createPod(serviceNS, podName);
pod = k8sClientUtil.createPodWithEnv(podName,serviceNS,proxyUrl,mountPath,pvcName,image);
} }
String loginCmd = "docker login -u " + harborUser +" -p "+harborpassword+" "+harborUrl; String loginCmd = "docker login -u " + harborUser +" -p "+harborpassword+" "+harborUrl;
// 执行命令 docker login -u admin -p Harbor12345 172.20.32.187 // 执行命令 docker login -u admin -p Harbor12345 172.20.32.187
@@ -346,8 +346,4 @@ public class ImageServiceImpl implements ImageService {
String path = loginUser.getUsername()+"/"+file.getOriginalFilename(); String path = loginUser.getUsername()+"/"+file.getOriginalFilename();
return minioService.uploadFile(bucketName, path, file); return minioService.uploadFile(bucketName, path, file);
} }

private V1Pod createPod(String namespace, String podName){
return k8sClientUtil.createPodWithEnv(podName,namespace,proxyUrl,mountPath,pvcName,image);
}
} }

Loading…
Cancel
Save