Merge branch 'dev' into dev-zw

This commit is contained in:
cp3hnu 2024-04-24 10:58:28 +08:00
commit 29b0e264de
1 changed files with 2 additions and 3 deletions

View File

@ -317,9 +317,8 @@ public class ImageServiceImpl implements ImageService {
String logs2 = k8sClientUtil.executeCommand(pod,"docker load -i "+filePath);
// 在容器里执行 docker tag name:tag nexus3.kube-system.svc:8083/imageName:imageTag
if (StringUtils.isNoneBlank(logs2)){
String substring = logs2.substring(logs2.lastIndexOf(harborUrl));
String cleanedString = substring.replaceAll("(\\r|\\n)", "");
String tagCmd = "docker tag " + cleanedString + " " + harborUrl + "/" + repository + "/" + username + "/" + imageName + ":" + imageTag;
String substring = logs2.substring(logs2.indexOf(":")+1).trim();
String tagCmd = "docker tag " + substring + " " + harborUrl + "/" + repository + "/" + username + "/" + imageName + ":" + imageTag;
String imageUrl = harborUrl + "/" + repository + "/" + username + "/" + imageName + ":" + imageTag;
String pushCmd = "docker push " + imageUrl;
String sizeCmd = "docker inspect --format='{{.Size}}' " + imageUrl;