Skip to content
This repository was archived by the owner on Apr 13, 2020. It is now read-only.

Commit ca3adb9

Browse files
committed
Disable static component creation when disableRouteScaffold
- When a service is `disableRouteScaffold: true`, the static component where the IngressRoute and Middleware was place is longer `fab add`ed
1 parent b25b797 commit ca3adb9

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/commands/hld/reconcile.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -549,9 +549,9 @@ describe("reconcile tests", () => {
549549
expect(dependencies.createServiceComponent).toHaveBeenCalledTimes(1);
550550
expect(dependencies.createRingComponent).toHaveBeenCalledTimes(1);
551551
expect(dependencies.addChartToRing).toHaveBeenCalledTimes(1);
552-
expect(dependencies.createStaticComponent).toHaveBeenCalledTimes(1);
553552

554553
// Skipping route generation.
554+
expect(dependencies.createStaticComponent).toHaveBeenCalledTimes(0);
555555
expect(dependencies.createMiddlewareForRing).not.toHaveBeenCalled();
556556
expect(dependencies.createIngressRouteForRing).not.toHaveBeenCalled();
557557
});

src/commands/hld/reconcile.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -277,12 +277,6 @@ export const reconcileHld = async (
277277
serviceConfig
278278
);
279279

280-
// Create config directory, create static manifest directory.
281-
await dependencies.createStaticComponent(
282-
dependencies.exec,
283-
normalizedRingPathInHld
284-
);
285-
286280
// Service explicitly requests no ingress-routes to be generated.
287281
if (serviceConfig.disableRouteScaffold) {
288282
logger.info(
@@ -291,6 +285,12 @@ export const reconcileHld = async (
291285
continue;
292286
}
293287

288+
// Create config directory, create static manifest directory.
289+
await dependencies.createStaticComponent(
290+
dependencies.exec,
291+
normalizedRingPathInHld
292+
);
293+
294294
// Calculate shared path for both IngressRoute and Middleware
295295
const ingressVersionAndPath = getFullPathPrefix(
296296
serviceConfig.pathPrefixMajorVersion || "",

0 commit comments

Comments
 (0)