[ Project ] 适配前端部分代码

This commit is contained in:
zeaslity
2023-08-02 14:30:01 +08:00
parent 98467f9590
commit 8e2eacfa47
22 changed files with 596 additions and 142 deletions

View File

@@ -189,7 +189,7 @@ func parseAgentServerInfo(agentServerInfoConf string) *register.AgentServerInfo
}
log.Info(fmt.Sprintf("agent server info is %v", string(jsonFormat)))
// build a operator cache
// build operator cache
BuildAgentOsOperator(agentServerInfo)
return agentServerInfo
@@ -197,21 +197,13 @@ func parseAgentServerInfo(agentServerInfoConf string) *register.AgentServerInfo
func BuildAgentOsOperator(agentServerInfo *register.AgentServerInfo) {
executor.AgentOsOperatorCache = &executor.AgentOsOperator{
InstallCommandPrefix: []string{
"apt-get", "install", "-y",
},
RemoveCommandPrefix: []string{"apt", "remove", "-y"},
CanAccessInternet: true,
IsOsTypeUbuntu: true,
IsAgentInnerWall: true,
AgentArch: "amd64",
AgentOSReleaseCode: "focal",
AgentServerInfo: agentServerInfo,
}
// call the init exec function
agentOsOperator := executor.BuildAgentOsOperator(agentServerInfo.OSInfo)
// assign the agentServerInfo
agentOsOperator.AgentServerInfo = agentServerInfo
// debug
marshal, _ := json.Marshal(executor.AgentOsOperatorCache)
log.DebugF("cached agent operator is %s", marshal)
marshal, _ := json.Marshal(agentOsOperator)
log.DebugF("[Agent INIT] cached agent operator is %s", marshal)
}