From 3458491e7b5bb946586442e348b5a5396941c3c8 Mon Sep 17 00:00:00 2001 From: Mathew Davies Date: Tue, 24 Mar 2020 16:32:12 +0000 Subject: [PATCH 1/2] fix(k8s): if the output is json, stringify it --- garden-service/src/plugins/kubernetes/status/pod.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/garden-service/src/plugins/kubernetes/status/pod.ts b/garden-service/src/plugins/kubernetes/status/pod.ts index 9d3baa160c..8710714ab3 100644 --- a/garden-service/src/plugins/kubernetes/status/pod.ts +++ b/garden-service/src/plugins/kubernetes/status/pod.ts @@ -113,6 +113,10 @@ export async function getPodLogs({ } } + if (typeof(log) === "object") { + log = JSON.stringify(log) + } + // the API returns undefined if no logs have been output, for some reason return { containerName, log: log || "" } }) From 877dd96dfc5a5f3f342ae64dd8cc87a3a4c770c9 Mon Sep 17 00:00:00 2001 From: Mathew Davies Date: Tue, 24 Mar 2020 16:51:54 +0000 Subject: [PATCH 2/2] chore(k8s): fix linting --- garden-service/src/plugins/kubernetes/status/pod.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/garden-service/src/plugins/kubernetes/status/pod.ts b/garden-service/src/plugins/kubernetes/status/pod.ts index 8710714ab3..cccaa35c89 100644 --- a/garden-service/src/plugins/kubernetes/status/pod.ts +++ b/garden-service/src/plugins/kubernetes/status/pod.ts @@ -113,7 +113,7 @@ export async function getPodLogs({ } } - if (typeof(log) === "object") { + if (typeof log === "object") { log = JSON.stringify(log) }