From e652d9f6e68684f624afb658eadec1ebec266755 Mon Sep 17 00:00:00 2001 From: Micah Nagel Date: Sat, 14 Dec 2024 16:31:21 -0700 Subject: [PATCH] fix: full tail + previous logs --- .github/actions/save-logs/action.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/actions/save-logs/action.yaml b/.github/actions/save-logs/action.yaml index 0a52f77bb..3c3046564 100644 --- a/.github/actions/save-logs/action.yaml +++ b/.github/actions/save-logs/action.yaml @@ -59,8 +59,10 @@ runs: uds zarf tools kubectl get pods -n pepr-system echo "::endgroup::" echo "::group::Fetch pepr logs" - uds zarf tools kubectl logs -n pepr-system -l app=pepr-uds-core > /tmp/pepr-logs.log - uds zarf tools kubectl logs -n pepr-system -l app=pepr-uds-core-watcher > /tmp/pepr-watcher-logs.log + uds zarf tools kubectl logs -n pepr-system -l app=pepr-uds-core --tail -1 > /tmp/pepr-logs.log + uds zarf tools kubectl logs -n pepr-system -l app=pepr-uds-core --tail -1 --previous > /tmp/pepr-previous-logs.log || true + uds zarf tools kubectl logs -n pepr-system -l app=pepr-uds-core-watcher --tail -1 > /tmp/pepr-watcher-logs.log + uds zarf tools kubectl logs -n pepr-system -l app=pepr-uds-core-watcher --tail -1 --previous > /tmp/pepr-watcher-previous-logs.log || true echo "::endgroup::" echo "::group::Describe Failed Packages" FAILED_PACKAGES=($(uds zarf tools kubectl get package -A -o jsonpath="{range .items[?(@.status.phase!='Ready')]}{.metadata.name}{','}{.metadata.namespace}{'\n'}{end}")); for PACKAGE in "${FAILED_PACKAGES[@]}"; do PACKAGE_NAME=$(echo "$PACKAGE" | awk -F "," '{print $1}'); PACKAGE_NAMESPACE=$(echo "$PACKAGE" | awk -F "," '{print $2}'); uds zarf tools kubectl describe "$PACKAGE_NAME" -n "$PACKAGE_NAMESPACE"; echo; done