[ Cmii ] [ Operator ] - bug fix of harbor executor

This commit is contained in:
zeaslity
2024-04-12 15:26:33 +08:00
parent 866220f2e4
commit c4b1c66f60
4 changed files with 11 additions and 17 deletions

View File

@@ -4,7 +4,6 @@ import (
"context"
"encoding/json"
"fmt"
"net"
"os"
"strconv"
"strings"
@@ -117,17 +116,11 @@ func (hOp *HarborOperator) CreateProjectExec(funcArgs []string) (bool, []string)
return true, []string{successLog}
}
// todo refresh HarborClient不一定有端口
func (hOp *HarborOperator) CheckAndBuildHarborClient(targetHarborHost string, targetHarborPort string, isTarget bool) (bool, *apiv2.RESTClient) {
log.InfoF("[Harbor Client Create] - start to create harbor client %s", targetHarborHost)
parseIP := net.ParseIP(targetHarborHost)
if parseIP == nil {
log.Error(
fmt.Sprintf("[Harbor Client Create] - ip format is wrong! parseIP is => %s ", parseIP),
)
return false, nil
}
if targetHarborPort == "" {
targetHarborPort = hOp.HarborPort
}

View File

@@ -183,9 +183,10 @@ public class HarborFuncScheduler {
// first func args
syncHarborArgList.add(masterNode.getServerIpInV4());
// second arg sourceHarborHost
// String sourceHarborHost = getIPv4Address();
// syncHarborArgList.add("harbor.wdd.io"); // local
syncHarborArgList.add("192.168.0.6:8034"); // public
syncHarborArgList.add("harbor.wdd.io"); // local
// syncHarborArgList.add("192.168.0.6:8034"); // public
// third arg sync project name
syncHarborArgList.add(projectDeployContext.getCurrentSynchronizingProject());
@@ -220,8 +221,8 @@ public class HarborFuncScheduler {
String os = System
.getProperty("os.name")
.toLowerCase();
// String devHarborSourceHost = "10.250.0.100";
String devHarborSourceHost = "20.4.16.200"; // cqga
String devHarborSourceHost = "10.250.0.100";
// String devHarborSourceHost = "20.4.16.200"; // cqga
if (os.contains("linux")) {
try {
InetAddress localhost = InetAddress.getLocalHost();

View File

@@ -9,7 +9,7 @@ spring:
allow-circular-references: true
allow-bean-definition-overriding: true
rabbitmq:
host: 10.250.0.100
host: 42.192.52.227
port: 20672
username: boge
password: boge8tingH
@@ -24,7 +24,7 @@ spring:
max-interval: 65000
initial-interval: 65000
redis:
host: 10.250.0.100
host: 42.192.52.227
port: 21370
database: 0
password: boge8tingH
@@ -46,7 +46,7 @@ spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://10.250.0.100:21306/octopus_server?autoReconnect=true&useSSL=false&useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2B8
url: jdbc:mysql://42.192.52.227:21306/octopus_server?autoReconnect=true&useSSL=false&useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2B8
username: boge
password: boge8tingH
type: com.zaxxer.hikari.HikariDataSource

View File

@@ -116,10 +116,10 @@ public class TestBaseFuncScheduler {
throw new RuntimeException(e);
}
baseFuncScheduler.runProcedure(projectDeployContext);
// baseFuncScheduler.runProcedure(projectDeployContext);
// harborFuncScheduler.runProcedure(projectDeployContext);
harborFuncScheduler.runProcedure(projectDeployContext);
List<AppFunctionEnum> appFunctionEnumList = List.of(