diff --git a/lib/mtx/server.js b/lib/mtx/server.js index 80d7bead..e89e4b3a 100644 --- a/lib/mtx/server.js +++ b/lib/mtx/server.js @@ -372,9 +372,8 @@ const _deleteObjectStoreInstance = async (sm_url, instanceID, token) => { } cds.on('listening', async () => { - const profiles = cds.env.profiles ?? [cds.env.profile] const objectStoreKind = cds.env.requires?.attachments?.objectStore?.kind - if (profiles.includes('mtx-sidecar') && cds.env.requires?.attachments?.kind !== 'db') { + if (cds.env.requires?.multitenancy && cds.env.requires?.attachments?.kind !== 'db') { const ds = await cds.connect.to("cds.xt.DeploymentService") if (objectStoreKind === "separate") { ds.after('subscribe', async (_, req) => { @@ -386,11 +385,11 @@ cds.on('listening', async () => { const token = await _fetchToken(url, clientid, clientsecret, certificate, key) - const existingTenantBindings = await fetchObjectStoreBinding(tenant, token); + const existingTenantBindings = await fetchObjectStoreBinding(tenant, token) if (existingTenantBindings.length) { LOG.info(`Existing tenant specific object store for ${tenant} exists. Skipping creation of new one.`) - return; + return } const offeringID = await _getOfferingID(sm_url, token)