-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Fleet] Rename CONFIG_CHANGE
action to POLICY_CHANGE
#78221
[Fleet] Rename CONFIG_CHANGE
action to POLICY_CHANGE
#78221
Conversation
Pinging @elastic/ingest-management (Team:Ingest Management) |
if (newAgentAction.data.policy) { | ||
newAgentAction.data.policy.outputs.default.api_key = apiKey; | ||
} | ||
// BWC for agent <= 7.9 |
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.
what about 7.9.1 and 7.9.2 which are already realeased?
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.
i see in test it will work,
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.
yep, <= 7.9.x
// Transform the policy action for agent version <= 7.9 for BWC | ||
const agentVersion = semver.parse((agent.local_metadata?.elastic as any)?.agent?.version); | ||
const agentPolicyAction: AgentPolicyAction | AgentPolicyActionV7_9 = | ||
agentVersion && semver.lt(agentVersion, '7.10.0') |
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.
Should we already have an issue to keep of track of these kind of change that need to be removed later?
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.
I will start a meta issue
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.
Looks good to me (after functional test are fixed) 🚀
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.
Tested this with branch elastic/beats#20779 and it received POLICY_CHANGE correctly.
@elasticmachine merge upstream |
@nchaulet This just came to mind, do you think it is possible to have "in-flight" policy change actions that haven't been acknowledged by the agent yet when the user upgrades to 7.10 Kibana? If so, should I add a SO migration to change the |
@jen-huang Yes it probably possible that happens, 👍 to have the migration to be safe |
@nchaulet Thanks for confirming, I pushed up a change to add migration for agent actions. |
@elasticmachine merge upstream |
💚 Build SucceededMetrics [docs]
History
To update your PR or re-run it, just comment with: |
* Initial pass at config->policy change action * Make policy change action BWC with agent <= 7.9 * Fix test * Add agent action SO migration for policy change actions Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
… (#78798) * [Fleet] Rename `CONFIG_CHANGE` action to `POLICY_CHANGE` (#78221) * Initial pass at config->policy change action * Make policy change action BWC with agent <= 7.9 * Fix test * Add agent action SO migration for policy change actions Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> * Add temporary logging for CI debugging * Fix condition and adjust tests * Revert "Add temporary logging for CI debugging" This reverts commit 4b578eb. Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Summary
Renames
CONFIG_CHANGE
action type toPOLICY_CHANGE
to support the corresponding agent changes in elastic/beats#20779. This also renames thedata.config
field todata.policy
.To ensure backwards compatibility (BWC) with agent <= v7.9, transforms were added to createAgentActionFromPolicyAction(). If the agent version is <= v7.9, we send
CONFIG_CHANGE
anddata.config
instead. Unit tests were added here against various agent versions.