From b39bd1acbc52f09ec236ddc86030682a02078290 Mon Sep 17 00:00:00 2001 From: Adam Stokes <51892+adam-stokes@users.noreply.github.com> Date: Thu, 1 Apr 2021 16:39:18 -0400 Subject: [PATCH] Remove the agent config file parameters for stand alone Signed-off-by: Adam Stokes <51892+adam-stokes@users.noreply.github.com> --- .../services/elastic-agent/docker-compose.yml | 2 -- e2e/_suites/fleet/stand-alone.go | 33 +++---------------- 2 files changed, 4 insertions(+), 31 deletions(-) diff --git a/cli/config/compose/services/elastic-agent/docker-compose.yml b/cli/config/compose/services/elastic-agent/docker-compose.yml index c5c0180254..ff855ce544 100644 --- a/cli/config/compose/services/elastic-agent/docker-compose.yml +++ b/cli/config/compose/services/elastic-agent/docker-compose.yml @@ -19,5 +19,3 @@ services: platform: ${elasticAgentPlatform:-linux/amd64} ports: - "127.0.0.1:8220:8220" - volumes: - - "${elasticAgentConfigFile}:/usr/share/elastic-agent/elastic-agent.yml" diff --git a/e2e/_suites/fleet/stand-alone.go b/e2e/_suites/fleet/stand-alone.go index 9f219ee323..f4378d93ae 100644 --- a/e2e/_suites/fleet/stand-alone.go +++ b/e2e/_suites/fleet/stand-alone.go @@ -7,7 +7,6 @@ package main import ( "context" "fmt" - "os" "strings" "time" @@ -22,10 +21,9 @@ import ( // StandAloneTestSuite represents the scenarios for Stand-alone-mode type StandAloneTestSuite struct { - AgentConfigFilePath string - Cleanup bool - Hostname string - Image string + Cleanup bool + Hostname string + Image string // date controls for queries AgentStoppedDate time.Time RuntimeDependenciesStartDate time.Time @@ -45,21 +43,6 @@ func (sats *StandAloneTestSuite) afterScenario() { } else { log.WithField("service", serviceName).Info("Because we are running in development mode, the service won't be stopped") } - - if _, err := os.Stat(sats.AgentConfigFilePath); err == nil { - beatsLocalPath := shell.GetEnv("BEATS_LOCAL_PATH", "") - if beatsLocalPath == "" { - os.Remove(sats.AgentConfigFilePath) - - log.WithFields(log.Fields{ - "path": sats.AgentConfigFilePath, - }).Trace("Elastic Agent configuration file removed.") - } else { - log.WithFields(log.Fields{ - "path": sats.AgentConfigFilePath, - }).Trace("Elastic Agent configuration file not removed because it's part of a repository.") - } - } } func (sats *StandAloneTestSuite) contributeSteps(s *godog.ScenarioContext) { @@ -102,11 +85,6 @@ func (sats *StandAloneTestSuite) startAgent(image string, env map[string]string) dockerImageTag += "-amd64" } - configurationFilePath, err := steps.FetchBeatConfiguration(true, "elastic-agent", "elastic-agent.docker.yml") - if err != nil { - return err - } - serviceManager := services.NewServiceManager() profileEnv["elasticAgentDockerImageSuffix"] = "" @@ -118,10 +96,7 @@ func (sats *StandAloneTestSuite) startAgent(image string, env map[string]string) containerName := fmt.Sprintf("%s_%s_%d", FleetProfileName, ElasticAgentServiceName, 1) - sats.AgentConfigFilePath = configurationFilePath - profileEnv["elasticAgentContainerName"] = containerName - profileEnv["elasticAgentConfigFile"] = sats.AgentConfigFilePath profileEnv["elasticAgentPlatform"] = "linux/amd64" profileEnv["elasticAgentTag"] = dockerImageTag @@ -129,7 +104,7 @@ func (sats *StandAloneTestSuite) startAgent(image string, env map[string]string) profileEnv[k] = v } - err = serviceManager.AddServicesToCompose(context.Background(), FleetProfileName, []string{ElasticAgentServiceName}, profileEnv) + err := serviceManager.AddServicesToCompose(context.Background(), FleetProfileName, []string{ElasticAgentServiceName}, profileEnv) if err != nil { log.Error("Could not deploy the elastic-agent") return err