[ Agent ] [ Executor ] 初步完成部署的函数功能

This commit is contained in:
zeaslity
2023-08-08 14:25:01 +08:00
parent 8e2eacfa47
commit e5af31bb38
8 changed files with 872 additions and 4 deletions

View File

@@ -27,6 +27,9 @@ type AgentOsOperator struct {
AgentOSReleaseCode string `json:"agent_os_release_code",comment:"主机操作系统的发行版代号, focal之类的"`
AgentServerInfo *register.AgentServerInfo `json:"agent_server_info"`
// 离线下载URL地址
OssOfflinePrefix string
}
// Exec 执行基础功能函数
@@ -86,7 +89,6 @@ func (op *AgentOsOperator) Exec(baseFuncName string, funcArgs ...string) []strin
break
default:
multiLineCommand = op.ok(funcArgs)
}
log.DebugF("multiLineCommand are => %v", multiLineCommand)
@@ -95,7 +97,10 @@ func (op *AgentOsOperator) Exec(baseFuncName string, funcArgs ...string) []strin
// exec the command here
for _, singleLineCommand := range multiLineCommand {
result = append(result, AllOutputCommandExecutor(singleLineCommand)...)
singleCommandResult := AllOutputCommandExecutor(singleLineCommand)
result = append(result, "")
result = append(result, singleCommandResult...)
// debug usage
log.DebugF("exec result are => %v", result)