From b214a175f724b9442a9e1f21f31d35b8b58a0014 Mon Sep 17 00:00:00 2001 From: Jacob Tomlinson Date: Thu, 12 Oct 2023 17:29:02 +0100 Subject: [PATCH] Fix pod logs --- dask_kubernetes/operator/kubecluster/kubecluster.py | 4 ++-- requirements.txt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dask_kubernetes/operator/kubecluster/kubecluster.py b/dask_kubernetes/operator/kubecluster/kubecluster.py index e37f1be9b..575fdef11 100644 --- a/dask_kubernetes/operator/kubecluster/kubecluster.py +++ b/dask_kubernetes/operator/kubecluster/kubecluster.py @@ -383,7 +383,7 @@ async def _create_cluster(self): raise SchedulerStartupError( "Scheduler failed to start.", "Scheduler Pod logs:", - await scheduler_pod.logs(), + "\n".join([line async for line in scheduler_pod.logs()]), ) from e self._log("Waiting for scheduler service") await wait_for_service(f"{self.name}-scheduler", self.namespace) @@ -579,7 +579,7 @@ async def _get_logs(self): raise ValueError( f"Cannot get logs for pod with status {pod.status.phase}.", ) - log = Log(await pod.logs()) + log = Log("\n".join([line async for line in pod.logs()])) except ValueError: log = Log(f"Cannot find logs. Pod is {pod.status.phase}.") logs[pod.name] = log diff --git a/requirements.txt b/requirements.txt index 5df21cbb5..d7a850edf 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,4 +5,4 @@ kubernetes-asyncio>=12.0.1 kopf>=1.35.3 pykube-ng>=22.9.0 rich>=12.5.1 -kr8s>=0.8.19 +kr8s>=0.9.0