use catalogServiceRef from plugin-catalog-node for catalogClient

Signed-off-by: Jonathan Roebuck <jroebuck@spotify.com>
This commit is contained in:
Jonathan Roebuck
2023-07-12 09:55:59 +01:00
parent 6951966004
commit 2d783af0ba
4 changed files with 8 additions and 9 deletions
+1
View File
@@ -44,6 +44,7 @@
"@backstage/catalog-client": "workspace:^",
"@backstage/catalog-model": "workspace:^",
"@backstage/config": "workspace:^",
"@backstage/plugin-catalog-node": "workspace:^",
"@backstage/plugin-lighthouse-common": "workspace:^",
"@backstage/types": "workspace:^",
"winston": "^3.2.1"
+4 -4
View File
@@ -19,7 +19,8 @@ import {
createBackendPlugin,
coreServices,
} from '@backstage/backend-plugin-api';
import { CatalogClient } from '@backstage/catalog-client';
import { catalogServiceRef } from '@backstage/plugin-catalog-node';
import { createScheduler } from './service/createScheduler';
/**
@@ -32,15 +33,14 @@ export const lighthousePlugin = createBackendPlugin({
register(env) {
env.registerInit({
deps: {
catalogClient: catalogServiceRef,
config: coreServices.config,
discovery: coreServices.discovery,
logger: coreServices.logger,
scheduler: coreServices.scheduler,
tokenManager: coreServices.tokenManager,
},
async init({ config, discovery, logger, scheduler, tokenManager }) {
async init({ catalogClient, config, logger, scheduler, tokenManager }) {
const winstonLogger = loggerToWinstonLogger(logger);
const catalogClient = new CatalogClient({ discoveryApi: discovery });
await createScheduler({
catalogClient,
@@ -16,10 +16,7 @@
import { Logger } from 'winston';
import { PluginTaskScheduler } from '@backstage/backend-tasks';
import {
CATALOG_FILTER_EXISTS,
CatalogClient,
} from '@backstage/catalog-client';
import { CATALOG_FILTER_EXISTS, CatalogApi } from '@backstage/catalog-client';
import { Config } from '@backstage/config';
import { LighthouseRestApi } from '@backstage/plugin-lighthouse-common';
import { stringifyEntityRef } from '@backstage/catalog-model';
@@ -31,7 +28,7 @@ export interface CreateLighthouseSchedulerOptions {
logger: Logger;
config: Config;
scheduler?: PluginTaskScheduler;
catalogClient: CatalogClient;
catalogClient: CatalogApi;
tokenManager: TokenManager;
}
+1
View File
@@ -7694,6 +7694,7 @@ __metadata:
"@backstage/catalog-model": "workspace:^"
"@backstage/cli": "workspace:^"
"@backstage/config": "workspace:^"
"@backstage/plugin-catalog-node": "workspace:^"
"@backstage/plugin-lighthouse-common": "workspace:^"
"@backstage/types": "workspace:^"
winston: ^3.2.1