Skip to content

Commit 8713884

Browse files
brijeshgajjarfyndpooransuthar1999
authored andcommitted
Multicluster support changes and cluster origin added
1 parent 55d36d9 commit 8713884

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

express/api_routes.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ function setupProxyRoutes(extension) {
1111

1212
applicationProxyRoutes.use(["/:cluster_id", "/"],async (req, res, next) => {
1313
try {
14-
const clusterId = req.params.cluster_id;
14+
const clusterId = req.params.cluster_id || req.query.cluster_origin;
15+
console.log(clusterId, "Cluster Id of the Extension");
1516
if (clusterId) {
1617
extension = ExtensionFactory.getExtension(clusterId)
1718
}

express/extension_factory.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class ExtensionFactory {
88
static getExtension(clusterId) {
99
const clusterExt = ExtensionFactory._extensionMap[clusterId]
1010
if (clusterId !== null && !clusterExt) {
11-
throw FdkInvalidCluster(`Extension instance not found for clusterId ${clusterId}`);
11+
throw new FdkInvalidCluster(`Extension instance not found for clusterId ${clusterId}`);
1212
}
1313
return clusterExt;
1414
}

express/routes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ function setupRoutes(ext) {
1515
FdkRoutes.get(["/:cluster_id/fp/install", "/fp/install"], async (req, res, next) => {
1616
// ?company_id=1&client_id=123313112122
1717
try {
18-
const cluster_id = req.params.cluster_id;
18+
const cluster_id = req.query.cluster_url || req.params.cluster_id;
1919
if (cluster_id) {
2020
ext = ExtensionFactory.getExtension(cluster_id)
2121
}

express/webhook.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ class WebhookRegistry {
291291
}
292292
try {
293293
const { body } = req;
294-
const clusterId = req.params.cluster_id;
294+
const clusterId = body.referer || req.params.cluster_id;
295295
if (body.event.name === TEST_WEBHOOK_EVENT_NAME) {
296296
return;
297297
}

0 commit comments

Comments
 (0)