Skip to content

Commit

Permalink
monitor dns in cilium e2e (#1597)
Browse files Browse the repository at this point in the history
(cherry picked from commit 6dd2f0a)
  • Loading branch information
lut777 authored and oilbeater committed Jun 19, 2022
1 parent 3dc2904 commit 4935fa6
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions dist/images/kubectl-ko
Original file line number Diff line number Diff line change
Expand Up @@ -395,15 +395,22 @@ checkDaemonSet(){

checkDeployment(){
name="$1"
ready=$(kubectl get deployment -n $KUBE_OVN_NS "$name" -o jsonpath={.status.readyReplicas})
updated=$(kubectl get deployment -n $KUBE_OVN_NS "$name" -o jsonpath={.status.updatedReplicas})
desire=$(kubectl get deployment -n $KUBE_OVN_NS "$name" -o jsonpath={.status.replicas})
available=$(kubectl get deployment -n $KUBE_OVN_NS "$name" -o jsonpath={.status.availableReplicas})
if [ "$ready" = "$updated" ] && [ "$updated" = "$desire" ] && [ "$desire" = "$available" ]; then
echo "deployment $name ready"
else
isfailed=true
for i in {0..29}
do
ready=$(kubectl get deployment -n $KUBE_OVN_NS "$name" -o jsonpath={.status.readyReplicas})
updated=$(kubectl get deployment -n $KUBE_OVN_NS "$name" -o jsonpath={.status.updatedReplicas})
desire=$(kubectl get deployment -n $KUBE_OVN_NS "$name" -o jsonpath={.status.replicas})
available=$(kubectl get deployment -n $KUBE_OVN_NS "$name" -o jsonpath={.status.availableReplicas})
if [ "$ready" = "$updated" ] && [ "$updated" = "$desire" ] && [ "$desire" = "$available" ]; then
echo "deployment $name ready"
isfailed=false
break
fi
sleep 1
done
if $isfailed; then
echo "Error deployment $name not ready"
exit 1
fi
}

Expand Down

0 comments on commit 4935fa6

Please sign in to comment.