From 2b3af238ba479326b0710fed0297dd46cc9bca6d Mon Sep 17 00:00:00 2001 From: Nils Hamerlinck Date: Fri, 23 Sep 2022 21:05:21 +0700 Subject: [PATCH] [FIX] builds /log endpoint (#73) --- src/runboat/k8s.py | 3 +++ src/runboat/kubefiles/deployment.yaml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/src/runboat/k8s.py b/src/runboat/k8s.py index adb345e..305ce0c 100644 --- a/src/runboat/k8s.py +++ b/src/runboat/k8s.py @@ -282,6 +282,9 @@ def log(build_name: str, job_kind: DeploymentMode | None) -> str | None: corev1.read_namespaced_pod_log( pod.metadata.name, namespace=settings.build_namespace, + container=pod.metadata.annotations.get( + "kubectl.kubernetes.io/default-container" + ), tail_lines=None if job_kind else None, follow=False, ), diff --git a/src/runboat/kubefiles/deployment.yaml b/src/runboat/kubefiles/deployment.yaml index f7b7acc..7067550 100644 --- a/src/runboat/kubefiles/deployment.yaml +++ b/src/runboat/kubefiles/deployment.yaml @@ -15,6 +15,8 @@ spec: metadata: labels: app: odoo + annotations: + kubectl.kubernetes.io/default-container: odoo spec: # let Odoo stop gracefully to disconnect from postgres terminationGracePeriodSeconds: 10