Skip to content

Commit 92330c5

Browse files
authored
fix(cli): preserve auth templates (#5906)
## TL;DR Fixes Kong reloads dropping the custom nginx configuration,<br> so custom Auth email templates no longer silently fall back to GoTrue defaults adds the configured nginx template to the reload command w focused coverage... ## Ref * closes #5905
1 parent e44a2bd commit 92330c5

2 files changed

Lines changed: 18 additions & 4 deletions

File tree

apps/cli/src/legacy/commands/functions/serve/serve.integration.test.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,19 @@ describe("legacy functions serve integration", () => {
508508
},
509509
});
510510

511+
expect(deployMockState.runCalls).toContainEqual({
512+
command: "docker",
513+
args: [
514+
"exec",
515+
"supabase_kong_test-project",
516+
"kong",
517+
"reload",
518+
"--nginx-conf",
519+
"/home/kong/custom_nginx.template",
520+
],
521+
options: { stdout: "ignore", stderr: "pipe" },
522+
});
523+
511524
expect(childSpawner.spawned).toEqual([
512525
{
513526
command: "docker",

apps/cli/src/shared/functions/serve.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1225,10 +1225,11 @@ const bestEffortRemoveContainer = Effect.fnUntraced(function* (containerId: stri
12251225
const reloadKong = Effect.fnUntraced(function* (projectId: string) {
12261226
const output = yield* Output;
12271227
const kongId = localDockerId("kong", projectId);
1228-
const result = yield* runChildProcess("docker", ["exec", kongId, "kong", "reload"], {
1229-
stdout: "ignore",
1230-
stderr: "pipe",
1231-
}).pipe(Effect.catch(() => Effect.succeed({ exitCode: 1, stdout: "", stderr: "" })));
1228+
const result = yield* runChildProcess(
1229+
"docker",
1230+
["exec", kongId, "kong", "reload", "--nginx-conf", "/home/kong/custom_nginx.template"],
1231+
{ stdout: "ignore", stderr: "pipe" },
1232+
).pipe(Effect.catch(() => Effect.succeed({ exitCode: 1, stdout: "", stderr: "" })));
12321233

12331234
if (result.exitCode !== 0) {
12341235
const suffix = result.stderr.trim().length > 0 ? ` ${result.stderr.trim()}` : "";

0 commit comments

Comments
 (0)