Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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] Move Fleet Setup to
start
lifecycle #117552[Fleet] Move Fleet Setup to
start
lifecycle #117552Changes from 1 commit
3f504b9
ff41a00
7f5330c
b377871
539e6a3
ee899c3
28c6fbf
252cf54
b5d900b
6c2f05e
1fc6f01
06afb9e
c850ae8
23c4ac1
8fe61e2
e135fdd
6311892
4c2e113
0682d83
162dbd6
3c019ba
8e2e1be
ede4a18
95475d4
f1f9fc6
c937d62
76e4829
1c4a465
76138ec
59190ba
697f8be
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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 think we should move this promise constructor outside the
fleetSetupCompleted
function so that it isn't called each timefleetSetupCompleted
is called and instead just return the already-constructed Promise. Also what is callingfleetSetupCompleted
? I don't think we should rely on this being called for setup to run.Also more of a nit, but I don't think you need the Promise constructor and you can just use an async function directly:
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.
Fleet doesn't call
fleetSetupCompleted
on its own, but thesecurity_solution
plugin does rely on it to handle some of their dependent setup logic here:kibana/x-pack/plugins/security_solution/server/plugin.ts
Lines 368 to 381 in 828a579
Agreed on restructuring this - it doesn't need a
Promise
constructor anymore.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 still don't think we should rely on security solution to call this. In fact, we or they may remove this in 8.0 as part of removing our BWC code for pre-GA fleet. We can still support this API for now by initiating the Fleet setup directly in the
start
function before the return statement, but just don't await the promise and instead return it fromfleetSetupCompleted()
.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.
Moved this logic out of
fleetSetupCompleted
so we don't need to rely on security solution calling it.