[ Server ] [ Harbor ] - sync projects - 10

This commit is contained in:
zeaslity
2023-11-16 11:58:13 +08:00
parent e520ddc66d
commit 96a871d371

View File

@@ -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 return true, nil
} }
func (hOp *HarborOperator) Command(baseFuncName string, funcArgs ...string) []string { func (hOp *HarborOperator) Command(baseFuncName string, funcArgs ...string) []string {