Skip to content

Commit 7c0081d

Browse files
committed
Add kcpPath to Luigi context configuration and processing
1 parent 61e8866 commit 7c0081d

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

projects/lib/portal-options/services/crd-gateway-kcp-patch-resolver.service.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export class CrdGatewayKcpPatchResolver {
1818
this.gatewayService.updateCrdGatewayUrlWithEntityPath(
1919
nextNode.context.kcpPath,
2020
);
21-
return;
21+
return nextNode.context.kcpPath;
2222
}
2323

2424
let entityKcpPath = kind !== 'Account' || !entityId ? '' : `:${entityId}`;
@@ -38,5 +38,6 @@ export class CrdGatewayKcpPatchResolver {
3838
if (!nextNode.context.kcpPath) {
3939
nextNode.context.kcpPath = kcpPath;
4040
}
41+
return kcpPath;
4142
}
4243
}

projects/lib/portal-options/services/node-context-processing.service.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,12 @@ export class NodeContextProcessingServiceImpl
2929
return;
3030
}
3131

32-
await this.crdGatewayKcpPatchResolver.resolveCrdGatewayKcpPath(
33-
entityNode,
34-
entityId,
35-
kind,
36-
);
32+
const kcpPath =
33+
await this.crdGatewayKcpPatchResolver.resolveCrdGatewayKcpPath(
34+
entityNode,
35+
entityId,
36+
kind,
37+
);
3738

3839
const operation = replaceDotsAndHyphensWithUnderscores(group);
3940
const namespaceId =
@@ -65,10 +66,12 @@ export class NodeContextProcessingServiceImpl
6566
);
6667

6768
// update the current already calculated by Luigi context for a node
69+
ctx.kcpPath = kcpPath;
6870
ctx.entity = entity;
6971
ctx.entityName = entityId;
7072
ctx.entityId = `${entity.metadata?.annotations?.['kcp.io/cluster']}/${entityId}`;
7173
// update the node context of sa node to contain the entity for future context calculations
74+
entityNode.context.kcpPath = kcpPath;
7275
entityNode.context.entity = entity;
7376
entityNode.context.entityName = ctx.entityName;
7477
entityNode.context.entityId = ctx.entityId;

0 commit comments

Comments
 (0)