[ Cmii ] [ Octopus ] - add Image Function Scheduler - 1

This commit is contained in:
zeaslity
2024-03-27 10:56:50 +08:00
parent cde509d137
commit 08c526c4a4
17 changed files with 373 additions and 33 deletions

View File

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