-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
[Elastic Agent] Fix picking correct policy id for fleet-server #25352
Conversation
When running the container command, the policy id configured in the fleet-setup.yml file was only picked up, when fleet-server was not enabled. If a fleet-server policy is set, this will be set as the default. Later on this setup call should be improved that not both setups are possible. Currently it could be that the fleet enroll and fleet server setup policy are not identical. To partially test this PR, I did run the elastic agent locally as following: ``` sudo STATE_PATH=${GOPATH}/src/github.com/elastic/beats/x-pack/elastic-agent/state ./elastic-agent container ``` Adjust the path to your needs. In addition, I put the currently checked in fleet-setup.yml file into state directory. In parallel, an elastic-stack setup was running.
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.
Change is correct, for this path.
Pinging @elastic/agent (Team:Agent) |
💚 Build Succeeded
Expand to view the summary
Build stats
Test stats 🧪
Trends 🧪💚 Flaky test reportTests succeeded. Expand to view the summary
Test stats 🧪
|
With elastic/elastic-package#338 I managed to test this change and it seems to work as expected. I built the agent container locally and then used it in the environment:
Currently it is required to do this on 7.13 as master does not have the most recent snapshot builds yet. |
When running the container command, the policy id configured in the fleet-setup.yml file was only picked up, when fleet-server was not enabled. If a fleet-server policy is set, this will be set as the default. Later on this setup call should be improved that not both setups are possible. Currently it could be that the fleet enroll and fleet server setup policy are not identical. To partially test this PR, I did run the elastic agent locally as following: ``` sudo STATE_PATH=${GOPATH}/src/github.com/elastic/beats/x-pack/elastic-agent/state ./elastic-agent container ``` Adjust the path to your needs. In addition, I put the currently checked in fleet-setup.yml file into state directory. In parallel, an elastic-stack setup was running. (cherry picked from commit 362d485)
When running the container command, the policy id configured in the fleet-setup.yml file was only picked up, when fleet-server was not enabled. If a fleet-server policy is set, this will be set as the default. Later on this setup call should be improved that not both setups are possible. Currently it could be that the fleet enroll and fleet server setup policy are not identical. To partially test this PR, I did run the elastic agent locally as following: ``` sudo STATE_PATH=${GOPATH}/src/github.com/elastic/beats/x-pack/elastic-agent/state ./elastic-agent container ``` Adjust the path to your needs. In addition, I put the currently checked in fleet-setup.yml file into state directory. In parallel, an elastic-stack setup was running. (cherry picked from commit 362d485)
… (#25363) When running the container command, the policy id configured in the fleet-setup.yml file was only picked up, when fleet-server was not enabled. If a fleet-server policy is set, this will be set as the default. Later on this setup call should be improved that not both setups are possible. Currently it could be that the fleet enroll and fleet server setup policy are not identical. To partially test this PR, I did run the elastic agent locally as following: ``` sudo STATE_PATH=${GOPATH}/src/github.com/elastic/beats/x-pack/elastic-agent/state ./elastic-agent container ``` Adjust the path to your needs. In addition, I put the currently checked in fleet-setup.yml file into state directory. In parallel, an elastic-stack setup was running. (cherry picked from commit 362d485) Co-authored-by: Nicolas Ruflin <spam@ruflin.com>
… (#25362) When running the container command, the policy id configured in the fleet-setup.yml file was only picked up, when fleet-server was not enabled. If a fleet-server policy is set, this will be set as the default. Later on this setup call should be improved that not both setups are possible. Currently it could be that the fleet enroll and fleet server setup policy are not identical. To partially test this PR, I did run the elastic agent locally as following: ``` sudo STATE_PATH=${GOPATH}/src/github.com/elastic/beats/x-pack/elastic-agent/state ./elastic-agent container ``` Adjust the path to your needs. In addition, I put the currently checked in fleet-setup.yml file into state directory. In parallel, an elastic-stack setup was running. (cherry picked from commit 362d485) Co-authored-by: Nicolas Ruflin <spam@ruflin.com>
When running the container command, the policy id configured in the fleet-setup.yml file was only picked up, when fleet-server was not enabled. If a fleet-server policy is set, this will be set as the default.
Later on this setup call should be improved that not both setups are possible. Currently it could be that the fleet enroll and fleet server setup policy are not identical.
To partially test this PR, I did run the elastic agent locally as following:
Adjust the path to your needs. In addition, I put the currently checked in fleet-setup.yml file into state directory. In parallel, an elastic-stack setup was running.