[ Cmii ] [ Operator ] - bug fix of harbor executor
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user