[ Server ] [ Harbor ] - sync projects
This commit is contained in:
@@ -63,7 +63,6 @@ func (hOp *HarborOperator) Exec(baseFuncName string, funcArgs ...string) (bool,
|
|||||||
|
|
||||||
func (hOp *HarborOperator) CreateProjectExec(funcArgs []string) (bool, []string) {
|
func (hOp *HarborOperator) CreateProjectExec(funcArgs []string) (bool, []string) {
|
||||||
|
|
||||||
client := hOp.TargetHarborClient
|
|
||||||
if hOp.TargetHarborClient == nil {
|
if hOp.TargetHarborClient == nil {
|
||||||
ok, createClient := hOp.CheckAndBuildHarborClient(funcArgs[0])
|
ok, createClient := hOp.CheckAndBuildHarborClient(funcArgs[0])
|
||||||
if !ok {
|
if !ok {
|
||||||
@@ -73,6 +72,7 @@ func (hOp *HarborOperator) CreateProjectExec(funcArgs []string) (bool, []string)
|
|||||||
}
|
}
|
||||||
hOp.TargetHarborClient = createClient
|
hOp.TargetHarborClient = createClient
|
||||||
}
|
}
|
||||||
|
client := hOp.TargetHarborClient
|
||||||
|
|
||||||
// create project
|
// create project
|
||||||
// 定义你想要创建的仓库(项目)的详细信息
|
// 定义你想要创建的仓库(项目)的详细信息
|
||||||
@@ -140,7 +140,6 @@ func (hOp *HarborOperator) CheckAndBuildHarborClient(targetHarborHost string) (b
|
|||||||
|
|
||||||
func (hOp *HarborOperator) ListProjectExec(funcArgs []string) (bool, []string) {
|
func (hOp *HarborOperator) ListProjectExec(funcArgs []string) (bool, []string) {
|
||||||
|
|
||||||
client := hOp.TargetHarborClient
|
|
||||||
if hOp.TargetHarborClient == nil {
|
if hOp.TargetHarborClient == nil {
|
||||||
ok, createClient := hOp.CheckAndBuildHarborClient(funcArgs[0])
|
ok, createClient := hOp.CheckAndBuildHarborClient(funcArgs[0])
|
||||||
if !ok {
|
if !ok {
|
||||||
@@ -150,6 +149,7 @@ func (hOp *HarborOperator) ListProjectExec(funcArgs []string) (bool, []string) {
|
|||||||
}
|
}
|
||||||
hOp.TargetHarborClient = createClient
|
hOp.TargetHarborClient = createClient
|
||||||
}
|
}
|
||||||
|
client := hOp.TargetHarborClient
|
||||||
|
|
||||||
// 使用客户端列出所有项目
|
// 使用客户端列出所有项目
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
|
|||||||
Reference in New Issue
Block a user