Skip to content

Commit

Permalink
fix kubectl ko using ovn-central pod that not in a good status (#2676)
Browse files Browse the repository at this point in the history
* fix kubectl ko using central pod that not in a good condition

* fix log error
  • Loading branch information
changluyi authored Apr 20, 2023
1 parent 9c5523f commit 3dc36c8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions dist/images/kubectl-ko
Original file line number Diff line number Diff line change
Expand Up @@ -566,15 +566,15 @@ diagnose(){
}

getOvnCentralPod(){
NB_POD=$(kubectl get pod -n $KUBE_OVN_NS -l ovn-nb-leader=true | grep ovn-central | head -n 1 | awk '{print $1}')
NB_POD=$(kubectl get pod -n $KUBE_OVN_NS -l ovn-nb-leader=true | grep ovn-central | awk '{if($2=="1/1" && $3=="Running") print $1}' | head -n 1 )
if [ -z "$NB_POD" ]; then
echo "nb leader not exists"
exit 1
fi
OVN_NB_POD=$NB_POD
SB_POD=$(kubectl get pod -n $KUBE_OVN_NS -l ovn-sb-leader=true | grep ovn-central | head -n 1 | awk '{print $1}')
SB_POD=$(kubectl get pod -n $KUBE_OVN_NS -l ovn-sb-leader=true | grep ovn-central | awk '{if($2=="1/1" && $3=="Running") print $1}' | head -n 1 )
if [ -z "$SB_POD" ]; then
echo "nb leader not exists"
echo "sb leader not exists"
exit 1
fi
OVN_SB_POD=$SB_POD
Expand Down

0 comments on commit 3dc36c8

Please sign in to comment.