From f57662856f973e57446add4b1a86fb3eaebb06d5 Mon Sep 17 00:00:00 2001 From: Ed Bartosh Date: Mon, 7 Jul 2025 15:58:13 +0300 Subject: [PATCH] local-up-cluster: store logs in artifacts directory Store logs in a temporary subdirectory under the artifacts directory when running in CI. This ensures logs are available in the prow web UI for easier access and debugging. --- hack/local-up-cluster.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/hack/local-up-cluster.sh b/hack/local-up-cluster.sh index 56de5e8b156..6f38e2c78c9 100755 --- a/hack/local-up-cluster.sh +++ b/hack/local-up-cluster.sh @@ -1359,6 +1359,13 @@ if [[ "${KUBETEST_IN_DOCKER:-}" == "true" ]]; then export PATH="${KUBE_ROOT}/third_party/etcd:${PATH}" KUBE_FASTBUILD=true make ginkgo cross + log_dir="${LOG_DIR}" + if [[ -n "${ARTIFACTS}" ]]; then + # Store logs in the artifacts directory so that they are + # available in the prow web UI. + log_dir="${ARTIFACTS}" + fi + echo "install additional packages" apt-get update apt-get install -y conntrack dnsutils nftables ripgrep sudo tree vim @@ -1385,7 +1392,7 @@ if [[ "${KUBETEST_IN_DOCKER:-}" == "true" ]]; then echo "DOCKER_OPTS=\"\${DOCKER_OPTS} --debug\"" >> /etc/default/docker # let's log it where we can grab it later - echo "DOCKER_LOGFILE=${LOG_DIR}/docker.log" >> /etc/default/docker + echo "DOCKER_LOGFILE=${log_dir}/docker.log" >> /etc/default/docker echo "stopping docker" service docker stop @@ -1404,7 +1411,7 @@ if [[ "${KUBETEST_IN_DOCKER:-}" == "true" ]]; then echo "starting containerd" containerd_endpoint="${CONTAINER_RUNTIME_ENDPOINT#unix://}" - start-stop-daemon --start --background --pidfile /var/run/containerd.pid --output ${LOG_DIR}/containerd.log \ + start-stop-daemon --start --background --pidfile /var/run/containerd.pid --output "${log_dir}/containerd.log" \ --exec /usr/bin/containerd -- --address "${containerd_endpoint}" kube::util::wait_for_success 60 2 "ctr --address ${containerd_endpoint} images list" if [ $? == "1" ]; then