[agent-go]-简化Agent 剔除Harbor K8s Image相关的内容

This commit is contained in:
zeaslity
2025-01-22 15:09:43 +08:00
parent 4edaf9f35a
commit 0d3bb30eed
15 changed files with 2569 additions and 2666 deletions

View File

@@ -102,25 +102,33 @@ func Execute(em *ExecutionMessage) (bool, []string) {
} else if strings.HasPrefix(em.ExecutionType, "HARBOR") {
// harbor function
if em.FuncContent == nil || len(em.FuncContent) <= 1 {
ok = false
resultLog = []string{
"[Harbor Execute] - functions args is wrong!",
}
//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:]...)
ok = true
resultLog = []string{
"null function!",
}
// 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!",
}
//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:]...)
ok = true
resultLog = []string{
"null function!",
}
// Harbor Execute
ok, resultLog = AgentOsOperatorCache.Sync(em.FuncContent[0], em.FuncContent[1:]...)
} else {
// deprecated
// shell command