diff --git a/modules/agent/api/setup.go b/modules/agent/api/setup.go index 433377d6..bcda07b5 100644 --- a/modules/agent/api/setup.go +++ b/modules/agent/api/setup.go @@ -119,20 +119,11 @@ func (h *APIHandler) getInstallScript(w http.ResponseWriter, req *http.Request, if downloadURL == "" { downloadURL = "https://release.infinilabs.com/agent/stable/" } - //esCfg := elastic.GetConfig(global.MustLookupString(elastic.GlobalSystemElasticsearchID)) - //var ( - // loggingESUser string - // loggingESPassword string - //) - //if esCfg.BasicAuth != nil { - // loggingESUser = esCfg.BasicAuth.Username - // loggingESPassword = esCfg.BasicAuth.Password - //} port := agCfg.Setup.Port if port == "" { port = "8080" } - tpl.Execute(w, map[string]interface{}{ + _, err = tpl.Execute(w, map[string]interface{}{ "base_url": agCfg.Setup.DownloadURL, "agent_version": agCfg.Setup.Version, "console_endpoint": agCfg.Setup.ConsoleEndpoint, @@ -141,9 +132,9 @@ func (h *APIHandler) getInstallScript(w http.ResponseWriter, req *http.Request, "ca_crt": caCert, "port": port, "token": tokenStr, - //"logging_es_endpoint": esCfg.Endpoint, - //"logging_es_user": loggingESUser, - //"logging_es_password": loggingESPassword, }) + if err != nil { + log.Error(err) + } } diff --git a/modules/agent/state/state.go b/modules/agent/state/state.go index 9a2d4a78..5a6b986c 100644 --- a/modules/agent/state/state.go +++ b/modules/agent/state/state.go @@ -203,22 +203,6 @@ func (sm *StateManager) syncSettings(agentID string) { return } err = agClient.SaveDynamicConfig(context.Background(), ag.GetEndpoint(), "dynamic_task", string(cfgBytes)) - //for _, pipelineID := range parseResult.ToDeletePipelineNames { - // err = agClient.DeletePipeline(context.Background(), ag.GetEndpoint(), pipelineID) - // if err != nil { - // if !strings.Contains(err.Error(), "not found") { - // log.Errorf("delete pipeline error: %v", err) - // continue - // } - // } - //} - //for _, pipeline := range parseResult.Pipelines { - // err = agClient.CreatePipeline(context.Background(), ag.GetEndpoint(), util.MustToJSONBytes(pipeline)) - // if err != nil { - // log.Errorf("create pipeline error: %v", err) - // return - // } - //} sm.timestamps[agentID] = newTimestamp }