Always add Manager setup route. Fleet, if enabled (#64859)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
This commit is contained in:
parent
d75328c476
commit
793d6f5689
|
@ -150,6 +150,7 @@ export class IngestManagerPlugin
|
|||
const config = await this.config$.pipe(first()).toPromise();
|
||||
|
||||
// Register routes
|
||||
registerSetupRoutes(router, config);
|
||||
registerAgentConfigRoutes(router);
|
||||
registerDatasourceRoutes(router);
|
||||
registerOutputRoutes(router);
|
||||
|
@ -162,7 +163,6 @@ export class IngestManagerPlugin
|
|||
}
|
||||
|
||||
if (config.fleet.enabled) {
|
||||
registerSetupRoutes(router);
|
||||
registerAgentRoutes(router);
|
||||
registerEnrollmentApiKeyRoutes(router);
|
||||
registerInstallScriptRoutes({
|
||||
|
|
|
@ -5,13 +5,14 @@
|
|||
*/
|
||||
import { IRouter } from 'src/core/server';
|
||||
import { PLUGIN_ID, FLEET_SETUP_API_ROUTES, SETUP_API_ROUTE } from '../../constants';
|
||||
import { IngestManagerConfigType } from '../../../common';
|
||||
import {
|
||||
getFleetSetupHandler,
|
||||
createFleetSetupHandler,
|
||||
ingestManagerSetupHandler,
|
||||
} from './handlers';
|
||||
|
||||
export const registerRoutes = (router: IRouter) => {
|
||||
export const registerRoutes = (router: IRouter, config: IngestManagerConfigType) => {
|
||||
// Ingest manager setup
|
||||
router.post(
|
||||
{
|
||||
|
@ -23,6 +24,11 @@ export const registerRoutes = (router: IRouter) => {
|
|||
},
|
||||
ingestManagerSetupHandler
|
||||
);
|
||||
|
||||
if (!config.fleet.enabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Get Fleet setup
|
||||
router.get(
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue