WIP. Strawman for doing setup in plugin#start#62709
WIP. Strawman for doing setup in plugin#start#62709jfsiii wants to merge 5 commits intoelastic:masterfrom jfsiii:epm-call-setup-from-plugin-not-view
Conversation
Still get failures while accessing certain urls. Not sure if it's the first time or while some other logic. Errors like 'No admin user configured', 'No default output', 'unable to authenticate user [fleet_enroll] for REST request [/_security/api_key]', etc
|
@nchaulet Can you take a look at this and leave your thoughts a) about the idea (calling setup logic in plugin lifecycle vs view) and b) about the errors that I mentioned? |
| public start(core: CoreStart) {} | ||
| public async start(core: CoreStart): Promise<IngestManagerStart> { | ||
| const config = this.config; | ||
| core.http.post('/api/ingest_manager/setup'); |
There was a problem hiding this comment.
Great catch! I think this was the cause of the errors but will confirm
|
I understand we want to hide the creation of the default config, For the errors can you give more context on how you get them? |
|
@nchaulet thanks for the quick and helpful comments
Yeah, that's totally reasonable. I can revert that part and we can always change later if we need to. |
|
|
||
| public start(core: CoreStart) {} | ||
| public async start(core: CoreStart): Promise<IngestManagerStart> { | ||
| const { isInitialized } = await core.http.post('/api/ingest_manager/setup'); |
There was a problem hiding this comment.
I am curious on how the app is going to react if this call throw an error
There was a problem hiding this comment.
Totally. I will explicitly handle it and return false for now and we can talk more about other options (retry then, later, etc)
💔 Build Failed
Failed CI StepsTest FailuresKibana Pipeline / kibana-xpack-agent / Chrome X-Pack UI Functional Tests.x-pack/test/functional/apps/machine_learning/feature_controls/ml_security·ts.machine learning feature controls security machine_learning_user and global all shows ML navlinkStandard OutStack TraceKibana Pipeline / kibana-xpack-agent / Chrome X-Pack UI Functional Tests.x-pack/test/functional/apps/machine_learning/feature_controls/ml_security·ts.machine learning feature controls security machine_learning_user and global all shows ML navlinkStandard OutStack TraceKibana Pipeline / kibana-xpack-agent / X-Pack API Integration Tests.x-pack/test/api_integration/apis/management/index_lifecycle_management/policies·js.apis management index lifecycle management policies list should have a default policy to manage the Watcher history indicesStandard OutStack TraceHistory
To update your PR or re-run it, just comment with: |
While the Ingest Manager and Fleet routes need to be run from Kibana / the browser due to required user information, I don't believe that means they must be called from a specific view.
I'd like to see if we can move the setup calls to the plugin's
startlifecycle. I want to test with Endpoint as an example consumer plugin.I'm not sure about the
isInitializedreturn value. That's just to use show a value being passed from IM to a dependency.