From 90c449cc0dd68ef46eb3c32bae170c3386238db9 Mon Sep 17 00:00:00 2001 From: Sami Tiilikainen <97873007+samitiilikainen@users.noreply.github.com> Date: Thu, 25 May 2023 16:23:18 +0300 Subject: [PATCH] fix: Handle log responses as text (#7776) Signed-off-by: Sami Tiilikainen <97873007+samitiilikainen@users.noreply.github.com> --- packages/core/src/common/k8s-api/endpoints/pod.api.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/core/src/common/k8s-api/endpoints/pod.api.ts b/packages/core/src/common/k8s-api/endpoints/pod.api.ts index c63f970edf..3b336de577 100644 --- a/packages/core/src/common/k8s-api/endpoints/pod.api.ts +++ b/packages/core/src/common/k8s-api/endpoints/pod.api.ts @@ -57,6 +57,12 @@ export class PodApi extends KubeApi { async getLogs(params: ResourceDescriptor, query?: PodLogsQuery): Promise { const path = `${this.getUrl(params)}/log`; - return this.request.get(path, { query }); + const logs = await this.request.get(path, { query }); + + if (typeof logs !== "string") { + return ""; + } + + return logs; } }