When using the PUT kbn:/api/fleet/agent_policies/:policy_id API to set overrides, it is not possible to specify flattened keys. For example, this request:
Create a new Agent policy with logs/metrics monitoring enabled.
View the policy YAML and check the value of agent.monitoring.enabled. It should be set to `true.
Use the policy override API (first example shown above) to set agent.monitoring.enabled to false.
View the policy YAML and check the value of agent.monitoring.enabled.
Expected behavior:
The value of agent.monitoring.enabled (unflattened) in the policy YAML is set to false. There is no flattened agent.monitoring.enabled key in the policy YAML.
Observed behavior:
A new flattened key, agent.monitoring.enabled is added to the policy YAML and it's value is set to false. However, the original, unflattened agent.monitoring.enabled key in the policy YAML still has it's value set to true.
Screenshots (if relevant):
Bug originally reported by @michel-laterman. Thanks!
Kibana version:
8.15.0
Elasticsearch version:
8.15.0
Describe the bug:
When using the
PUT kbn:/api/fleet/agent_policies/:policy_id
API to set overrides, it is not possible to specify flattened keys. For example, this request:... does not result in the same policy YAML as this request:
Steps to reproduce:
agent.monitoring.enabled
. It should be set to `true.agent.monitoring.enabled
tofalse
.agent.monitoring.enabled
.Expected behavior:
The value of
agent.monitoring.enabled
(unflattened) in the policy YAML is set tofalse
. There is no flattenedagent.monitoring.enabled
key in the policy YAML.Observed behavior:
A new flattened key,
agent.monitoring.enabled
is added to the policy YAML and it's value is set tofalse
. However, the original, unflattenedagent.monitoring.enabled
key in the policy YAML still has it's value set totrue
.Screenshots (if relevant):
Bug originally reported by @michel-laterman. Thanks!