[ Agent ] [ Initialization ] - add harbor func

This commit is contained in:
zeaslity
2023-11-09 10:34:30 +08:00
parent 11a1215cde
commit aae4b7a286
8 changed files with 395 additions and 182 deletions

View File

@@ -50,6 +50,16 @@ func Execute(em *ExecutionMessage) (bool, []string) {
ok, resultLog = AgentOsOperatorCache.Deploy(em.FuncContent[0])
}
} else if strings.HasPrefix(em.ExecutionType, "HARBOR") {
if em.FuncContent == nil || len(em.FuncContent) <= 1 {
ok = false
resultLog = []string{
"[Harbor Execute] - functions args is wrong!",
}
}
// Harbor Execute
ok, resultLog = HarborOperatorCache.Exec(em.FuncContent[0], em.FuncContent[1:]...)
} else {
// shell command
if em.PipeLineCommand != nil && len(em.PipeLineCommand) != 0 {