-
Notifications
You must be signed in to change notification settings - Fork 402
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
catalog-backend-module-okta new backend system #1310
Comments
@pmaterer you will need to use the scheduler to call the run method after an initial period of time and on a regular schedule. This will ensure that the provider will run periodically. You would probably do that like this:
|
Appreciate that! I ended up doing this: export default createBackendModule({
pluginId: 'catalog',
moduleId: 'okta-discovery-entity-provider',
register(env) {
env.registerInit({
deps: {
config: coreServices.rootConfig,
catalog: catalogProcessingExtensionPoint,
logger: coreServices.logger,
scheduler: coreServices.scheduler,
},
async init({ config, catalog, logger, scheduler }) {
const orgProvider = OktaOrgEntityProvider.fromConfig(config, {
logger: loggerToWinstonLogger(logger),
userNamingStrategy: 'strip-domain-email',
groupNamingStrategy: 'kebab-case-name',
});
catalog.addEntityProvider(orgProvider);
await scheduler.scheduleTask({
id: 'okta-org-entity-provider',
fn: () => {
orgProvider.run();
},
initialDelay: Duration.fromObject({ minutes: 2 }),
frequency: Duration.fromObject({ minutes: 5 }),
timeout: Duration.fromObject({ minutes: 10 })
});
},
});
},
}); And it appears to be working just fine. Thanks again! Considering there is a PR to update all plugins/modules to the new backend system (#1304) I will close this. |
Expected Behavior
I'm trying to migrate to the new backend system. I'm using the
catalog-backend-module-okta
backend plugin.Following the Backstage docs I'm doing something like this:
And then I start the backend:
However the provider doesn't actually run.
The docs show how to setup the provider using the old backend:
So you need to call the
run()
method for the provider to start, however it is not clear how to best do this in the new backend?If I call it after adding it like this:
I get an error:
From what I can tell the old backend would call the
connect()
function on all the entity providers when you callconst { processingEngine, router } = await builder.build();
.Is there a way to add this provider using the new backend?
The text was updated successfully, but these errors were encountered: