Skip to content
This repository was archived by the owner on Sep 17, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions cli/config/compose/services/elastic-agent/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,6 @@ services:
condition: service_healthy
environment:
- "KIBANA_HOST=http://${kibanaHost:-kibana}:${kibanaPort:-5601}"
- "FLEET_SERVER_ENABLE=${fleetServerMode:-0}"
- "FLEET_SERVER_INSECURE_HTTP=${fleetServerMode:-0}"
- "KIBANA_FLEET_SETUP=${fleetServerMode:-0}"
- "FLEET_SERVER_HOST=0.0.0.0"
- "KIBANA_USERNAME=elastic"
- "KIBANA_PASSWORD=changeme"
platform: ${elasticAgentPlatform:-linux/amd64}
ports:
- "127.0.0.1:8220:8220"
volumes:
- "${elasticAgentConfigFile}:/usr/share/elastic-agent/elastic-agent.yml"
10 changes: 0 additions & 10 deletions e2e/_suites/fleet/features/stand_alone_agent.feature
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,3 @@ Examples: default
Examples: Ubi8
| image |
| ubi8 |

@run_fleet_server
Scenario Outline: Deploying a <image> stand-alone agent with fleet server mode
When a "<image>" stand-alone agent is deployed with fleet server mode
Then the stand-alone agent is listed in Fleet as "online"

@default
Examples: default
| image |
| default |
12 changes: 4 additions & 8 deletions e2e/_suites/fleet/fleet.go
Original file line number Diff line number Diff line change
Expand Up @@ -406,10 +406,6 @@ func (fts *FleetTestSuite) setup() error {
}

func (fts *FleetTestSuite) theAgentIsListedInFleetWithStatus(desiredStatus string) error {
return theAgentIsListedInFleetWithStatus(desiredStatus, fts.Hostname)
}

func theAgentIsListedInFleetWithStatus(desiredStatus, hostname string) error {
log.Tracef("Checking if agent is listed in Fleet as %s", desiredStatus)

maxTimeout := time.Duration(timeoutFactor) * time.Minute * 2
Expand All @@ -418,7 +414,7 @@ func theAgentIsListedInFleetWithStatus(desiredStatus, hostname string) error {
exp := e2e.GetExponentialBackOff(maxTimeout)

agentOnlineFn := func() error {
agentID, err := getAgentID(hostname)
agentID, err := getAgentID(fts.Hostname)
if err != nil {
retryCount++
return err
Expand All @@ -429,7 +425,7 @@ func theAgentIsListedInFleetWithStatus(desiredStatus, hostname string) error {
if desiredStatus == "offline" || desiredStatus == "inactive" {
log.WithFields(log.Fields{
"elapsedTime": exp.GetElapsedTime(),
"hostname": hostname,
"hostname": fts.Hostname,
"retries": retryCount,
"status": desiredStatus,
}).Info("The Agent is not present in Fleet, as expected")
Expand All @@ -450,7 +446,7 @@ func theAgentIsListedInFleetWithStatus(desiredStatus, hostname string) error {
"agentID": agentID,
"isAgentInStatus": isAgentInStatus,
"elapsedTime": exp.GetElapsedTime(),
"hostname": hostname,
"hostname": fts.Hostname,
"retry": retryCount,
"status": desiredStatus,
}).Warn(err.Error())
Expand All @@ -463,7 +459,7 @@ func theAgentIsListedInFleetWithStatus(desiredStatus, hostname string) error {
log.WithFields(log.Fields{
"isAgentInStatus": isAgentInStatus,
"elapsedTime": exp.GetElapsedTime(),
"hostname": hostname,
"hostname": fts.Hostname,
"retries": retryCount,
"status": desiredStatus,
}).Info("The Agent is in the desired status")
Expand Down
19 changes: 0 additions & 19 deletions e2e/_suites/fleet/stand-alone.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,27 +64,12 @@ func (sats *StandAloneTestSuite) afterScenario() {

func (sats *StandAloneTestSuite) contributeSteps(s *godog.ScenarioContext) {
s.Step(`^a "([^"]*)" stand-alone agent is deployed$`, sats.aStandaloneAgentIsDeployed)
s.Step(`^a "([^"]*)" stand-alone agent is deployed with fleet server mode$`, sats.aStandaloneAgentIsDeployedWithFleetServerMode)
s.Step(`^there is new data in the index from agent$`, sats.thereIsNewDataInTheIndexFromAgent)
s.Step(`^the "([^"]*)" docker container is stopped$`, sats.theDockerContainerIsStopped)
s.Step(`^there is no new data in the index after agent shuts down$`, sats.thereIsNoNewDataInTheIndexAfterAgentShutsDown)
s.Step(`^the stand-alone agent is listed in Fleet as "([^"]*)"$`, sats.theAgentIsListedInFleetWithStatus)
}

func (sats *StandAloneTestSuite) theAgentIsListedInFleetWithStatus(desiredStatus string) error {
return theAgentIsListedInFleetWithStatus(desiredStatus, sats.Hostname)
}

func (sats *StandAloneTestSuite) aStandaloneAgentIsDeployedWithFleetServerMode(image string) error {
return sats.startAgent(image, map[string]string{"fleetServerMode": "1"})
}

func (sats *StandAloneTestSuite) aStandaloneAgentIsDeployed(image string) error {
return sats.startAgent(image, nil)
}

func (sats *StandAloneTestSuite) startAgent(image string, env map[string]string) error {

log.Trace("Deploying an agent to Fleet")

dockerImageTag := agentVersion
Expand Down Expand Up @@ -125,10 +110,6 @@ func (sats *StandAloneTestSuite) startAgent(image string, env map[string]string)
profileEnv["elasticAgentPlatform"] = "linux/amd64"
profileEnv["elasticAgentTag"] = dockerImageTag

for k, v := range env {
profileEnv[k] = v
}

err = serviceManager.AddServicesToCompose(context.Background(), FleetProfileName, []string{ElasticAgentServiceName}, profileEnv)
if err != nil {
log.Error("Could not deploy the elastic-agent")
Expand Down