-
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] fixing bug with preconfigured fleet server policy missing input #124363
Conversation
Pinging @elastic/fleet (Team:Fleet) |
@@ -344,7 +344,7 @@ export async function ensurePreconfiguredPackagesAndPolicies( | |||
policy!, | |||
packagePoliciesToAdd!, | |||
defaultOutput, | |||
!created | |||
true |
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.
this is the bumpRevision
flag, which was previously set to false on create (and true on update), it is used here:
So the agent policy has to be version bumped after creating and assigning the new package policy.
kibana/x-pack/plugins/fleet/server/services/package_policy.ts
Lines 177 to 204 in b8c1323
const newSo = await soClient.create<PackagePolicySOAttributes>( | |
SAVED_OBJECT_TYPE, | |
{ | |
...packagePolicy, | |
inputs, | |
elasticsearch, | |
revision: 1, | |
created_at: isoDate, | |
created_by: options?.user?.username ?? 'system', | |
updated_at: isoDate, | |
updated_by: options?.user?.username ?? 'system', | |
}, | |
{ ...options, id: packagePolicyId } | |
); | |
// Assign it to the given agent policy | |
await agentPolicyService.assignPackagePolicies( | |
soClient, | |
esClient, | |
packagePolicy.policy_id, | |
[newSo.id], | |
{ | |
user: options?.user, | |
bumpRevision: options?.bumpRevision ?? true, | |
force: options?.force, | |
} | |
); |
Should we backport to 8.0 and 7.17 ? I think we should |
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.
🚀
@elasticmachine merge upstream |
💚 Build SucceededMetrics [docs]
History
To update your PR or re-run it, just comment with: |
…ted README (elastic#124363) Co-authored-by: Kibana Machine <[email protected]> (cherry picked from commit 1f507c9)
💔 Some backports could not be created
How to fixRe-run the backport manually:
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…ted README (#124363) (#124400) Co-authored-by: Kibana Machine <[email protected]> (cherry picked from commit 1f507c9) Co-authored-by: Julia Bardi <[email protected]>
…ted README (elastic#124363) Co-authored-by: Kibana Machine <[email protected]>
…ted README (#124363) (#124657) Co-authored-by: Kibana Machine <[email protected]> Co-authored-by: Kibana Machine <[email protected]>
We have validated merges related to PR on 8.0 BC1 build at Cloud and on-prem env both.
Please let us know if more validations are required to be performed under manual side on this ticket. Thanks |
…ted README (elastic#124363) Co-authored-by: Kibana Machine <[email protected]>
…ted README (#124363) (#125041) Co-authored-by: Kibana Machine <[email protected]> Co-authored-by: Kibana Machine <[email protected]>
…ted README (#124363) (#125043) Co-authored-by: Kibana Machine <[email protected]> Co-authored-by: Kibana Machine <[email protected]>
Came across a bug during testing preconfigured policies. When creating a preconfigured agent policy with package policy, the policy inputs were not reflected in
.fleet-policies
index until some other action was done that updated the policy.The reason is that the agent policy's revision was not bumped after creating the package policy and assigning it to the agent policy.
Steps to reproduce:
.fleet-policies
index: theinputs
array is empty:inputs
array should be populated:This bug also had a side effect that when trying to enroll fleet server to this preconfigured policy, it got stuck at some point due to the missing inputs.