separate "bootstrap" from retrieved config when running in agent mode #3464
Description
Follow up for #3411
fleet-server has been altered so that in agent-mode the policy self-monitor can send partial config updates to change output settings based off the output section of the fleet-server policy.
However this can introduce an edge case when the server is running where a policy-change unrelated to the output will result in the "bootstrap" output sent from the elastic-agent being used temporarily.
The sequence of events may be:
- ES hosts are set to A, B
- fleet-server is enrolled with host A
- policy monitor will send A, B to reload
- fleet-server policy is adjusted by user (i.e., max_agent has changed)
- elastic-agent will send updated policy with only host A (if the agent has not been restarted)
- policy monitor will then sent A, B to reload again
The issue here is the final reload where the fleet-server because the reload operation will restart the API server.
When receiving new output fleet-server may need to determine how to insert/inject output (and the revision idx value) into the config so that the output from policy does not trigger a second reload.