-
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
WIP. Strawman for doing setup in plugin#start #62709
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably missing an await here
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.
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. |
@@ -61,7 +63,11 @@ export class IngestManagerPlugin | |||
}); | |||
} | |||
|
|||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am curious on how the app is going to react if this call throw an error
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.
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 Out
Stack Trace
Kibana 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 Out
Stack Trace
Kibana 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 Out
Stack Trace
History
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
start
lifecycle. I want to test with Endpoint as an example consumer plugin.I'm not sure about the
isInitialized
return value. That's just to use show a value being passed from IM to a dependency.