From b7943fbec6d98dfc8b72d2039e2dac3bec72ef0f Mon Sep 17 00:00:00 2001 From: Artur Tagisow Date: Mon, 16 Dec 2024 13:22:45 +0100 Subject: [PATCH] ES-1393 Fix /readyz returning 503 if readinessProbes not defined in options --- .changeset/curly-gifts-hang.md | 7 +++++++ packages/middleware/src/terminus.ts | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 .changeset/curly-gifts-hang.md diff --git a/.changeset/curly-gifts-hang.md b/.changeset/curly-gifts-hang.md new file mode 100644 index 0000000000..68a435413f --- /dev/null +++ b/.changeset/curly-gifts-hang.md @@ -0,0 +1,7 @@ +--- +"@vue-storefront/middleware": patch +--- + +- **[FIXED]** Fix /readyz returning 503 if readinessProbes not passed in middleware.config.ts + +Before this fix, sending a GET request to `http://localhost:4000/readyz` would return { "status": "error" } and a HTTP 503 status. This happened only when `readinessProbes` wasn't added to middleware options (the default behavior) diff --git a/packages/middleware/src/terminus.ts b/packages/middleware/src/terminus.ts index 8dc7be5cdd..9948a7bd4e 100644 --- a/packages/middleware/src/terminus.ts +++ b/packages/middleware/src/terminus.ts @@ -30,7 +30,7 @@ export const createReadyzHandler = }; export const createTerminusOptions = ( - readinessChecks: ReadinessProbe[] + readinessChecks: ReadinessProbe[] = [] ): TerminusOptions => { return { useExit0: true,