Before this PR is merged, take any agent in staging in Fleet Automation and go to the configuration tab, runtime overrides layer: it has a lot of entries. But the runtime overrides layer is for configuration that is set by the agent depending on its environment, and not explicitly set by customers (such as check_runners for instance).
This is not the case for what we see today in staging, as it contains the api_key or other additional endpoints that take their key from the secrets backend. They are set by the user and don't fit in the runtime overrides layer.
This PR fixes it by replacing where needed SourceAgentRuntime by config.GetSource so we don't change the config entry's layer.
Motivation
Cleaner layers
Additional Notes
Possible Drawbacks / Trade-offs
Describe how to test/QA your changes
Create an agent on staging
Find it on Fleet Automation
Check that api_key isn't in the Runtime Overrides layer (shouldn't be here)
Alternatively, check if agents on a deployed build have the additional_endpoints in the Runtime Override layer (they shouldn't)
What does this PR do?
Before this PR is merged, take any agent in staging in Fleet Automation and go to the configuration tab, runtime overrides layer: it has a lot of entries. But the runtime overrides layer is for configuration that is set by the agent depending on its environment, and not explicitly set by customers (such as
check_runners
for instance).This is not the case for what we see today in staging, as it contains the
api_key
or other additional endpoints that take their key from the secrets backend. They are set by the user and don't fit in the runtime overrides layer.This PR fixes it by replacing where needed
SourceAgentRuntime
byconfig.GetSource
so we don't change the config entry's layer.Motivation
Cleaner layers
Additional Notes
Possible Drawbacks / Trade-offs
Describe how to test/QA your changes
api_key
isn't in the Runtime Overrides layer (shouldn't be here)Alternatively, check if agents on a deployed build have the
additional_endpoints
in the Runtime Override layer (they shouldn't)