elastic / elastic-agent

Elastic Agent - single, unified way to add monitoring for logs, metrics, and other types of data to a host.
Other
21 stars 144 forks source link

Fix audit/unenroll calls when agent runs fleet-server #6085

Open michel-laterman opened 2 days ago

michel-laterman commented 2 days ago

What does this PR do?

Call audit/unenroll (during uninstall) before components are stopped if the elastic-agent is running a fleet-server instance.

Why is it important?

Agents running fleet-server instances would always get an error because fleet-server would be stopped by the time the notify call is attempted.

Checklist

How to test this PR locally

Enroll an agent in a policy with the fleet-server integration and uninstall the agent

Related issues

elasticmachine commented 22 hours ago

Pinging @elastic/elastic-agent-control-plane (Team:Elastic-Agent-Control-Plane)

elastic-sonarqube[bot] commented 5 hours ago

Quality Gate failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 40%)

See analysis details on SonarQube