diff --git a/agent-go/executor/HarborExecutor.go b/agent-go/executor/HarborExecutor.go index 5b62fb2..9a59378 100644 --- a/agent-go/executor/HarborExecutor.go +++ b/agent-go/executor/HarborExecutor.go @@ -322,6 +322,24 @@ func (hOp *HarborOperator) SyncProjectExec(funcArgs []string) (bool, []string) { } } + realOctopusReplicationPolicy, err := targetClient.GetReplicationPolicyByName(ctx, octopusReplicationPolicyName) + if err != nil { + return false, []string{ + "[Harbor Sync Project ] - failed to get the realOctopusReplicationPolicy!", + err.Error(), + } + } + + err = targetClient.TriggerReplicationExecution(ctx, &model.StartReplicationExecution{ + PolicyID: realOctopusReplicationPolicy.ID, + }) + if err != nil { + return false, []string{ + "[Harbor Sync Project ] - failed to start the harbor sync execution !", + err.Error(), + } + } + return true, nil } func (hOp *HarborOperator) Command(baseFuncName string, funcArgs ...string) []string {