[ Cmii ] [ Operator ] - bug fix of harbor executor
This commit is contained in:
@@ -4,7 +4,6 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"net"
|
|
||||||
"os"
|
"os"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
@@ -117,17 +116,11 @@ func (hOp *HarborOperator) CreateProjectExec(funcArgs []string) (bool, []string)
|
|||||||
return true, []string{successLog}
|
return true, []string{successLog}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// todo refresh HarborClient不一定有端口
|
||||||
func (hOp *HarborOperator) CheckAndBuildHarborClient(targetHarborHost string, targetHarborPort string, isTarget bool) (bool, *apiv2.RESTClient) {
|
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)
|
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 == "" {
|
if targetHarborPort == "" {
|
||||||
targetHarborPort = hOp.HarborPort
|
targetHarborPort = hOp.HarborPort
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -183,9 +183,10 @@ public class HarborFuncScheduler {
|
|||||||
// first func args
|
// first func args
|
||||||
syncHarborArgList.add(masterNode.getServerIpInV4());
|
syncHarborArgList.add(masterNode.getServerIpInV4());
|
||||||
// second arg sourceHarborHost
|
// second arg sourceHarborHost
|
||||||
|
|
||||||
// String sourceHarborHost = getIPv4Address();
|
// String sourceHarborHost = getIPv4Address();
|
||||||
// syncHarborArgList.add("harbor.wdd.io"); // local
|
syncHarborArgList.add("harbor.wdd.io"); // local
|
||||||
syncHarborArgList.add("192.168.0.6:8034"); // public
|
// syncHarborArgList.add("192.168.0.6:8034"); // public
|
||||||
|
|
||||||
// third arg sync project name
|
// third arg sync project name
|
||||||
syncHarborArgList.add(projectDeployContext.getCurrentSynchronizingProject());
|
syncHarborArgList.add(projectDeployContext.getCurrentSynchronizingProject());
|
||||||
@@ -220,8 +221,8 @@ public class HarborFuncScheduler {
|
|||||||
String os = System
|
String os = System
|
||||||
.getProperty("os.name")
|
.getProperty("os.name")
|
||||||
.toLowerCase();
|
.toLowerCase();
|
||||||
// String devHarborSourceHost = "10.250.0.100";
|
String devHarborSourceHost = "10.250.0.100";
|
||||||
String devHarborSourceHost = "20.4.16.200"; // cqga
|
// String devHarborSourceHost = "20.4.16.200"; // cqga
|
||||||
if (os.contains("linux")) {
|
if (os.contains("linux")) {
|
||||||
try {
|
try {
|
||||||
InetAddress localhost = InetAddress.getLocalHost();
|
InetAddress localhost = InetAddress.getLocalHost();
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ spring:
|
|||||||
allow-circular-references: true
|
allow-circular-references: true
|
||||||
allow-bean-definition-overriding: true
|
allow-bean-definition-overriding: true
|
||||||
rabbitmq:
|
rabbitmq:
|
||||||
host: 10.250.0.100
|
host: 42.192.52.227
|
||||||
port: 20672
|
port: 20672
|
||||||
username: boge
|
username: boge
|
||||||
password: boge8tingH
|
password: boge8tingH
|
||||||
@@ -24,7 +24,7 @@ spring:
|
|||||||
max-interval: 65000
|
max-interval: 65000
|
||||||
initial-interval: 65000
|
initial-interval: 65000
|
||||||
redis:
|
redis:
|
||||||
host: 10.250.0.100
|
host: 42.192.52.227
|
||||||
port: 21370
|
port: 21370
|
||||||
database: 0
|
database: 0
|
||||||
password: boge8tingH
|
password: boge8tingH
|
||||||
@@ -46,7 +46,7 @@ spring:
|
|||||||
|
|
||||||
datasource:
|
datasource:
|
||||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
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
|
username: boge
|
||||||
password: boge8tingH
|
password: boge8tingH
|
||||||
type: com.zaxxer.hikari.HikariDataSource
|
type: com.zaxxer.hikari.HikariDataSource
|
||||||
|
|||||||
@@ -116,10 +116,10 @@ public class TestBaseFuncScheduler {
|
|||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
baseFuncScheduler.runProcedure(projectDeployContext);
|
// baseFuncScheduler.runProcedure(projectDeployContext);
|
||||||
|
|
||||||
|
|
||||||
// harborFuncScheduler.runProcedure(projectDeployContext);
|
harborFuncScheduler.runProcedure(projectDeployContext);
|
||||||
|
|
||||||
|
|
||||||
List<AppFunctionEnum> appFunctionEnumList = List.of(
|
List<AppFunctionEnum> appFunctionEnumList = List.of(
|
||||||
|
|||||||
Reference in New Issue
Block a user