-
Notifications
You must be signed in to change notification settings - Fork 154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ability to enroll with defined ID and replace_token #6498
base: main
Are you sure you want to change the base?
Conversation
This pull request does not have a backport label. Could you fix it @blakerouse? 🙏
|
|
Pinging @elastic/elastic-agent-control-plane (Team:Elastic-Agent-Control-Plane) |
) | ||
|
||
// Force uninstall the Agent (skipping information Fleet) | ||
output, err = fixture.Uninstall(ctx, &atesting.UninstallOpts{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what if this agent is running through a container and replace-token and/or agent-id change?! shouldn't it re-enroll?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it should. Forgot you added that new code to check those. I will look at updating this code to do that, and add to those tests as well.
|
What does this PR do?
Adds new
--id
(ELASTIC_AGENT_ID
env for container) and--replace-token
(FLEET_REPLACE_TOKEN
env for container) to enrollment.Why is it important?
Allows an Elastic Agent to enroll with a defined ID and replacement token to allow it to replace an existing Elastic Agent. The original Elastic Agent must have also been enrolled with the same
--replace-token
or it will not be allow to enroll if the--id
collides with an existing Elastic Agent.Checklist
[ ] I have made corresponding changes to the documentation[ ] I have made corresponding change to the default configuration files(no config changes)[ ] I have added tests that prove my fix is effective or that my feature works(cannot unit test)./changelog/fragments
using the changelog toolDisruptive User Impact
None
How to test this PR locally
You need this PR (elastic/fleet-server#4290) from Fleet Server and have that Fleet Server running to enroll. Then you can build this PR and run enroll with
--id
and--replace-token
.Related issues