From 7f757e8fee3414156f44bd5cdb08bb43c29d1635 Mon Sep 17 00:00:00 2001 From: Patrik Nordwall Date: Tue, 5 Dec 2023 14:42:39 +0100 Subject: [PATCH] more error diagnostics --- .../scripts/app-version-revision-kubernetes-test.sh | 7 ++++--- integration-test/scripts/kubernetes-test.sh | 2 ++ .../scripts/rollingupdate-kubernetes-cr-test.sh | 9 +++++---- .../scripts/rollingupdate-kubernetes-test.sh | 5 +++-- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/integration-test/scripts/app-version-revision-kubernetes-test.sh b/integration-test/scripts/app-version-revision-kubernetes-test.sh index 3a0e1bea4..4dbca9d74 100755 --- a/integration-test/scripts/app-version-revision-kubernetes-test.sh +++ b/integration-test/scripts/app-version-revision-kubernetes-test.sh @@ -27,7 +27,8 @@ testRevisionInPodsLog () { if [ $i -eq 20 ] then echo "Pods did not get ready (revision $1)" - kubectl -n $NAMESPACE describe deployment akka-rollingupdate-demo + kubectl -n $NAMESPACE events $APP_NAME + kubectl -n $NAMESPACE describe deployment $APP_NAME exit -1 fi @@ -56,7 +57,7 @@ testRevisionInPodsLog () { # prep docker images | head kubectl create namespace $NAMESPACE || true -kubectl -n $NAMESPACE delete deployment akka-rollingupdate-demo || true +kubectl -n $NAMESPACE delete deployment $APP_NAME || true kubectl -n $NAMESPACE apply -f $DEPLOYMENT # after the initial deployment @@ -70,4 +71,4 @@ testRevisionInPodsLog "2" kubectl rollout undo deployment/$APP_NAME -n $NAMESPACE testRevisionInPodsLog "3" -echo "Test Successful!" \ No newline at end of file +echo "Test Successful!" diff --git a/integration-test/scripts/kubernetes-test.sh b/integration-test/scripts/kubernetes-test.sh index 84a0a25b2..4db7e5300 100755 --- a/integration-test/scripts/kubernetes-test.sh +++ b/integration-test/scripts/kubernetes-test.sh @@ -19,6 +19,8 @@ done if [ $i -eq 10 ] then echo "Pods did not get ready" + kubectl -n $NAMESPACE events $APP_NAME + kubectl -n $NAMESPACE describe deployment $APP_NAME exit -1 fi diff --git a/integration-test/scripts/rollingupdate-kubernetes-cr-test.sh b/integration-test/scripts/rollingupdate-kubernetes-cr-test.sh index 593736034..a1b37f6d2 100755 --- a/integration-test/scripts/rollingupdate-kubernetes-cr-test.sh +++ b/integration-test/scripts/rollingupdate-kubernetes-cr-test.sh @@ -9,7 +9,7 @@ docker images | head kubectl create namespace $NAMESPACE || true kubectl apply -f $CRD -kubectl -n $NAMESPACE delete deployment akka-rollingupdate-demo || true +kubectl -n $NAMESPACE delete deployment $APP_NAME || true kubectl -n $NAMESPACE apply -f $DEPLOYMENT for i in {1..20} @@ -28,7 +28,8 @@ done if [ $i -eq 20 ] then echo "Pods did not get ready" - kubectl -n $NAMESPACE describe deployment akka-rollingupdate-demo + kubectl -n $NAMESPACE events $APP_NAME + kubectl -n $NAMESPACE describe deployment $APP_NAME exit -1 fi @@ -42,7 +43,7 @@ do pod_list=$(kubectl get pods -n $NAMESPACE | grep $APP_NAME | grep Running | awk '{ print $1 }' | sort) # Get the pods in the CR - cr_pod_list=$(kubectl describe podcosts.akka.io akka-rollingupdate-demo -n $NAMESPACE | grep "Pod Name" | awk '{print $3}' | sort) + cr_pod_list=$(kubectl describe podcosts.akka.io $APP_NAME -n $NAMESPACE | grep "Pod Name" | awk '{print $3}' | sort) if [ "$pod_list" = "$cr_pod_list" ] then @@ -55,7 +56,7 @@ do for pod_name in $pod_list do # Get the pod names from the cr - cr_pod_list=$(kubectl describe podcosts.akka.io akka-rollingupdate-demo -n $NAMESPACE | grep "Pod Name" | awk '{print $3}' | sort -z) + cr_pod_list=$(kubectl describe podcosts.akka.io $APP_NAME -n $NAMESPACE | grep "Pod Name" | awk '{print $3}' | sort -z) # Check if the annotation value is set or empty if ["$pod_list" == "$cr_pod_list" ] diff --git a/integration-test/scripts/rollingupdate-kubernetes-test.sh b/integration-test/scripts/rollingupdate-kubernetes-test.sh index 40fa9434d..1fb891b69 100755 --- a/integration-test/scripts/rollingupdate-kubernetes-test.sh +++ b/integration-test/scripts/rollingupdate-kubernetes-test.sh @@ -8,7 +8,7 @@ sbt $PROJECT_NAME/docker:publishLocal docker images | head kubectl create namespace $NAMESPACE || true -kubectl -n $NAMESPACE delete deployment akka-rollingupdate-demo || true +kubectl -n $NAMESPACE delete deployment $APP_NAME || true kubectl -n $NAMESPACE apply -f $DEPLOYMENT for i in {1..20} @@ -27,7 +27,8 @@ done if [ $i -eq 20 ] then echo "Pods did not get ready" - kubectl -n $NAMESPACE describe deployment akka-rollingupdate-demo + kubectl -n $NAMESPACE events $APP_NAME + kubectl -n $NAMESPACE describe deployment $APP_NAME exit -1 fi