From 87ca2c972e2b792c83844cf1f00fd6f81742f7f5 Mon Sep 17 00:00:00 2001 From: Patrik Nordwall Date: Wed, 6 Dec 2023 07:31:00 +0100 Subject: [PATCH] logs by label instead --- .../scripts/rollingupdate-kubernetes-test.sh | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/integration-test/scripts/rollingupdate-kubernetes-test.sh b/integration-test/scripts/rollingupdate-kubernetes-test.sh index 92e381bb..17ae3eec 100755 --- a/integration-test/scripts/rollingupdate-kubernetes-test.sh +++ b/integration-test/scripts/rollingupdate-kubernetes-test.sh @@ -27,17 +27,16 @@ done if [ $i -eq 20 ] then echo "Pods did not get ready" - kubectl -n $NAMESPACE events $APP_NAME - kubectl -n $NAMESPACE describe deployment $APP_NAME + kubectl events $APP_NAME -n $NAMESPACE + kubectl describe deployment $APP_NAME -n $NAMESPACE - pods=$(kubectl get pods -o jsonpath="{.items..metadata.name}" -n $NAMESPACE) - IFS=' ' read -ra pods_array <<< "$pods" - for p in "${pods_array[@]}" - do - echo "" - echo "Logs of pod $p" - kubectl -n $NAMESPACE logs $p - done + echo "" + echo "Logs from all $APP_NAME containers" + kubectl logs -l app=$APP_NAME --all-containers=true -n $NAMESPACE + + echo "" + echo "Logs from all previous $APP_NAME containers" + kubectl logs -p -l app=$APP_NAME --all-containers=true -n $NAMESPACE exit -1 fi