Merge pull request #2881 from Marvin9/chore/use-catalog-api

chore: use catalog API to fetch entity in scaffolder-backend
This commit is contained in:
Patrik Oldsberg
2020-11-05 11:17:34 +01:00
committed by GitHub
11 changed files with 181 additions and 52 deletions
+16
View File
@@ -0,0 +1,16 @@
---
'@backstage/plugin-scaffolder': minor
'@backstage/plugin-scaffolder-backend': minor
---
`createRouter` of scaffolder backend will now require additional option as `entityClient` which could be generated by `CatalogEntityClient` in `plugin-scaffolder-backend` package. Here is example to generate `entityClient`.
```js
import { CatalogEntityClient } from '@backstage/plugin-scaffolder-backend';
import { SingleHostDiscovery } from '@backstage/backend-common';
const discovery = SingleHostDiscovery.fromConfig(config);
const entityClient = new CatalogEntityClient({ discovery });
```
- Scaffolder's API `/v1/jobs` will accept `templateName` instead of `template` Entity.