Skip to content

Commit

Permalink
Add retries for cni conf file
Browse files Browse the repository at this point in the history
In CNI chain option, add retry to look for primary
cni config file before adding antrea config in it
  • Loading branch information
Rahul Jain committed Jun 24, 2020
1 parent fbb1dff commit 78853a0
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion build/images/scripts/install_cni_chaining
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
#!/usr/bin/env bash

source logging

# Find the cni conf file with lowest name
cni_conf=$(ls /host/etc/cni/net.d | head -n1)
while true; do
cni_conf=$(ls /host/etc/cni/net.d | head -n1)
if [[ ! -z $cni_conf ]]; then
break
fi
log_info "CNI conf file not found. Retrying after 2 secs"
sleep 2s
done
cni_conf="/host/etc/cni/net.d/$cni_conf"
cat $cni_conf | jq '.plugins[] | .type' | grep antrea > /dev/null 2>&1
if [[ $? != 0 ]]; then
Expand Down

0 comments on commit 78853a0

Please sign in to comment.