refactor goarch

This commit is contained in:
wh1te909 2022-06-20 12:23:51 -07:00
parent 959a1bb8c8
commit 73deda7d04
2 changed files with 1 additions and 10 deletions

View File

@ -141,7 +141,6 @@ func New(logger *logrus.Logger, version string) *Agent {
return &Agent{ return &Agent{
Hostname: info.Hostname, Hostname: info.Hostname,
Arch: info.Architecture,
BaseURL: ac.BaseURL, BaseURL: ac.BaseURL,
AgentID: ac.AgentID, AgentID: ac.AgentID,
ApiURL: ac.APIURL, ApiURL: ac.APIURL,

View File

@ -138,14 +138,6 @@ func (a *Agent) Install(i *Installer) {
rClient.SetProxy(i.Proxy) rClient.SetProxy(i.Proxy)
} }
var arch string
switch a.Arch {
case "x86_64":
arch = "64"
case "x86":
arch = "32"
}
var installerMeshSystemEXE string var installerMeshSystemEXE string
if len(i.MeshDir) > 0 { if len(i.MeshDir) > 0 {
installerMeshSystemEXE = filepath.Join(i.MeshDir, "MeshAgent.exe") installerMeshSystemEXE = filepath.Join(i.MeshDir, "MeshAgent.exe")
@ -159,7 +151,7 @@ func (a *Agent) Install(i *Installer) {
mesh := filepath.Join(a.ProgramDir, a.MeshInstaller) mesh := filepath.Join(a.ProgramDir, a.MeshInstaller)
if i.LocalMesh == "" { if i.LocalMesh == "" {
a.Logger.Infoln("Downloading mesh agent...") a.Logger.Infoln("Downloading mesh agent...")
payload := map[string]string{"arch": arch, "plat": a.Platform} payload := map[string]string{"goarch": a.GoArch, "plat": a.Platform}
r, err := rClient.R().SetBody(payload).SetOutput(mesh).Post(fmt.Sprintf("%s/api/v3/meshexe/", baseURL)) r, err := rClient.R().SetBody(payload).SetOutput(mesh).Post(fmt.Sprintf("%s/api/v3/meshexe/", baseURL))
if err != nil { if err != nil {
a.installerMsg(fmt.Sprintf("Failed to download mesh agent: %s", err.Error()), "error", i.Silent) a.installerMsg(fmt.Sprintf("Failed to download mesh agent: %s", err.Error()), "error", i.Silent)