Skip to content
This repository has been archived by the owner on Sep 17, 2024. It is now read-only.

Commit

Permalink
Add timeout safeguard to elastic-agent execution
Browse files Browse the repository at this point in the history
In some cases such as attempting to re-enroll with a revoked token, the
elastic-agent will retry indefinitely. This fix adds a safeguard utilizing
'timeout' command prepended to the elastic-agent command so that it will timeout
after TimeoutFactor

Signed-off-by: Adam Stokes <[email protected]>
  • Loading branch information
adam-stokes committed Apr 21, 2021
1 parent 3b5a727 commit f11ef39
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/installer/elasticagent.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package installer

import (
"context"
"fmt"

"github.com/elastic/e2e-testing/internal/common"
"github.com/elastic/e2e-testing/internal/compose"
Expand Down Expand Up @@ -63,7 +64,7 @@ func (i *ElasticAgentInstaller) ListElasticAgentWorkingDirContent(containerName
// runElasticAgentCommandEnv runs a command for the elastic-agent
func runElasticAgentCommandEnv(profile string, image string, service string, process string, command string, arguments []string, env map[string]string) error {
cmds := []string{
process, command,
"timeout", fmt.Sprintf("%dm", common.TimeoutFactor), process, command,
}
cmds = append(cmds, arguments...)

Expand Down

0 comments on commit f11ef39

Please sign in to comment.