Skip to content

Commit

Permalink
more error diagnostics
Browse files Browse the repository at this point in the history
  • Loading branch information
patriknw committed Dec 5, 2023
1 parent 25a6c05 commit 7f757e8
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand All @@ -70,4 +71,4 @@ testRevisionInPodsLog "2"
kubectl rollout undo deployment/$APP_NAME -n $NAMESPACE
testRevisionInPodsLog "3"

echo "Test Successful!"
echo "Test Successful!"
2 changes: 2 additions & 0 deletions integration-test/scripts/kubernetes-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
9 changes: 5 additions & 4 deletions integration-test/scripts/rollingupdate-kubernetes-cr-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -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

Expand All @@ -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
Expand All @@ -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" ]
Expand Down
5 changes: 3 additions & 2 deletions integration-test/scripts/rollingupdate-kubernetes-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -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

Expand Down

0 comments on commit 7f757e8

Please sign in to comment.