Skip to content

Commit

Permalink
[Fleet] Added readme about bumping agent policies on SO change (elast…
Browse files Browse the repository at this point in the history
…ic#201742)

## Summary

Resolves elastic#193352

Documented the usage of `bump_agent_policy_revision` and using
`revision` to bump on agent policy SO changes.

I think it's not needed to introduce `bump_agent_policy_revision` on the
agent policy SO type, enough to bump revision, and the agent policy will
be deployed on Fleet setup when
https://github.com/elastic/kibana/blob/main/x-pack/plugins/fleet/server/services/agent_policies/deploy_agent_policies_task.ts
is running.

---------

Co-authored-by: Cristina Amico <[email protected]>
  • Loading branch information
2 people authored and CAWilson94 committed Dec 12, 2024
1 parent fb79c16 commit d6cc094
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions x-pack/plugins/fleet/server/saved_objects/bump_agent_policies.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
## Agent policy SO changes

When making changes to agent policy SO, the changes are not automatically deployed to agents. To trigger an agent policy bump, add a new model version to the agent policy SO type with a revision increase.

```
'2': {
changes: [
{
type: 'data_backfill',
backfillFn: (doc) => {
return { attributes: { ...doc.attributes, revision: doc.attributes.revision + 1 } };
},
},
],
},
```

## Package policy SO changes

Similarly, package policy SO changes do not automatically trigger a redeploy of agent policies using them. To trigger an agent policy bump using package policies, add a new model version to the package policy SO type with `bump_agent_policy_revision: true`.

```
'2': {
changes: [
{
type: 'data_backfill',
backfillFn: (doc) => {
return { attributes: { ...doc.attributes, bump_agent_policy_revision: true } };
},
},
],
},
```

0 comments on commit d6cc094

Please sign in to comment.