Skip to content

Commit

Permalink
PMM-13399 Fix tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
BupycHuk committed Oct 21, 2024
1 parent 4545436 commit c8b3c51
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions agent/agents/supervisor/supervisor.go
Original file line number Diff line number Diff line change
Expand Up @@ -665,15 +665,6 @@ func (s *Supervisor) processParams(agentID string, agentProcess *agentv1.SetStat
templateParams := map[string]interface{}{
"listen_port": port,
}
templateParams["server_insecure"] = cfg.Server.InsecureTLS
templateParams["server_url"] = fmt.Sprintf("https://%s", cfg.Server.Address)
if cfg.Server.WithoutTLS {
templateParams["server_url"] = fmt.Sprintf("http://%s", cfg.Server.Address)
}
templateParams["server_host"] = cfg.Server.URL().Host
templateParams["server_password"] = cfg.Server.Password
templateParams["server_username"] = cfg.Server.Username
templateParams["tmp_dir"] = cfg.Paths.TempDir
switch agentProcess.Type {
case inventoryv1.AgentType_AGENT_TYPE_NODE_EXPORTER:
templateParams["paths_base"] = cfg.Paths.PathsBase
Expand All @@ -695,8 +686,17 @@ func (s *Supervisor) processParams(agentID string, agentProcess *agentv1.SetStat
case type_TEST_SLEEP:
processParams.Path = "sleep"
case inventoryv1.AgentType_AGENT_TYPE_VM_AGENT:
templateParams["server_insecure"] = cfg.Server.InsecureTLS
templateParams["server_url"] = fmt.Sprintf("https://%s", cfg.Server.Address)
if cfg.Server.WithoutTLS {
templateParams["server_url"] = fmt.Sprintf("http://%s", cfg.Server.Address)
}
templateParams["server_password"] = cfg.Server.Password
templateParams["server_username"] = cfg.Server.Username
templateParams["tmp_dir"] = cfg.Paths.TempDir
processParams.Path = cfg.Paths.VMAgent
case inventoryv1.AgentType_AGENT_TYPE_NOMAD_AGENT:
templateParams["server_host"] = cfg.Server.URL().Host
templateParams["nomad_data_dir"] = cfg.Paths.NomadDataDir
processParams.Path = cfg.Paths.Nomad
default:
Expand Down

0 comments on commit c8b3c51

Please sign in to comment.