diff --git a/.changeset/rare-elephants-arrive.md b/.changeset/rare-elephants-arrive.md new file mode 100644 index 0000000000..d27f763d1f --- /dev/null +++ b/.changeset/rare-elephants-arrive.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-catalog-backend-module-puppetdb': patch +--- + +Fixes import paths and updates documentation diff --git a/microsite/data/plugins/catalog-backend-module-puppetdb.yaml b/microsite/data/plugins/catalog-backend-module-puppetdb.yaml index 3eac117e19..e7a15ecd4a 100644 --- a/microsite/data/plugins/catalog-backend-module-puppetdb.yaml +++ b/microsite/data/plugins/catalog-backend-module-puppetdb.yaml @@ -5,7 +5,7 @@ authorUrl: https://github.com/tdabasinskas category: Configuration Management description: Import nodes from PuppetDB into Backstage as Resource Entities documentation: https://github.com/backstage/backstage/blob/master/plugins/catalog-backend-module-puppetdb/README.md -iconUrl: https://avatars.githubusercontent.com/u/234268?s=200&v=4 +iconUrl: /img/puppet.png npmPackageName: '@backstage/plugin-catalog-backend-module-puppetdb' tags: - puppet diff --git a/plugins/catalog-backend-module-puppetdb/README.md b/plugins/catalog-backend-module-puppetdb/README.md index d4782c6d18..9319299a06 100644 --- a/plugins/catalog-backend-module-puppetdb/README.md +++ b/plugins/catalog-backend-module-puppetdb/README.md @@ -31,9 +31,9 @@ Update the catalog plugin initialization in your backend to add the provider and + schedule: env.scheduler.createScheduledTaskRunner({ + frequency: { minutes: 10 }, + timeout: { minutes: 50 }, -+ initialDelay: { seconds: 15} ++ initialDelay: { seconds: 15 } + }), -+ }); ++ }) + ); ``` @@ -67,7 +67,7 @@ of overriding the default transformer. export const customResourceTransformer: ResourceTransformer = async ( node, config, -): Promise => { +): Promise => { // Transformations may change namespace, owner, change entity naming pattern, add labels, annotations, etc. // Create the Resource Entity on your own, or wrap the default transformer @@ -77,14 +77,16 @@ export const customResourceTransformer: ResourceTransformer = async ( 2. Configure the provider with the transformer: -```ts -const puppetDbEntityProvider = PuppetDbEntityProvider.fromConfig(env.config, { - logger: env.logger, - schedule: env.scheduler.createScheduledTaskRunner({ - frequency: { minutes: 10 }, - timeout: { minutes: 50 }, - initialDelay: { seconds: 15 }, - }), - transformer: customResourceTransformer, -}); +```diff + builder.addEntityProvider( + PuppetDbEntityProvider.fromConfig(env.config, { + logger: env.logger, ++ transformer: customResourceTransformer, + schedule: env.scheduler.createScheduledTaskRunner({ + frequency: { minutes: 10 }, + timeout: { minutes: 50 }, + initialDelay: { seconds: 15 } + }), + }) + ); ``` diff --git a/plugins/catalog-backend-module-puppetdb/src/providers/PuppetDbEntityProvider.test.ts b/plugins/catalog-backend-module-puppetdb/src/providers/PuppetDbEntityProvider.test.ts index ad89e1fd9a..42091fd6d6 100644 --- a/plugins/catalog-backend-module-puppetdb/src/providers/PuppetDbEntityProvider.test.ts +++ b/plugins/catalog-backend-module-puppetdb/src/providers/PuppetDbEntityProvider.test.ts @@ -28,7 +28,7 @@ import { ANNOTATION_LOCATION, ANNOTATION_ORIGIN_LOCATION, ResourceEntity, -} from '@backstage/catalog-model/'; +} from '@backstage/catalog-model'; import { DEFAULT_ENTITY_OWNER, ENDPOINT_NODES } from '../puppet/constants'; jest.mock('../puppet/read', () => { diff --git a/plugins/catalog-backend-module-puppetdb/src/providers/PuppetDbEntityProvider.ts b/plugins/catalog-backend-module-puppetdb/src/providers/PuppetDbEntityProvider.ts index 8c63baf467..a5286a9d70 100644 --- a/plugins/catalog-backend-module-puppetdb/src/providers/PuppetDbEntityProvider.ts +++ b/plugins/catalog-backend-module-puppetdb/src/providers/PuppetDbEntityProvider.ts @@ -31,7 +31,7 @@ import { ANNOTATION_LOCATION, ANNOTATION_ORIGIN_LOCATION, Entity, -} from '@backstage/catalog-model/'; +} from '@backstage/catalog-model'; import { merge } from 'lodash'; import { readPuppetNodes } from '../puppet/read'; import { ENDPOINT_NODES } from '../puppet/constants'; diff --git a/plugins/catalog-backend-module-puppetdb/src/puppet/read.ts b/plugins/catalog-backend-module-puppetdb/src/puppet/read.ts index 568ea7224e..ab3e85370a 100644 --- a/plugins/catalog-backend-module-puppetdb/src/puppet/read.ts +++ b/plugins/catalog-backend-module-puppetdb/src/puppet/read.ts @@ -16,7 +16,7 @@ import { PuppetDbEntityProviderConfig } from '../providers'; import { PuppetNode, ResourceTransformer } from './types'; -import { ResourceEntity } from '@backstage/catalog-model/'; +import { ResourceEntity } from '@backstage/catalog-model'; import { defaultResourceTransformer } from './transformers'; import fetch from 'node-fetch'; import { ResponseError } from '@backstage/errors';