Skip to content

Commit

Permalink
fix add empty route error
Browse files Browse the repository at this point in the history
  • Loading branch information
BSWANG committed Oct 26, 2021
1 parent f240320 commit 6d53ae1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/up.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function pod_cidrs() {

function add_routes() {
unset IFS
routes=$(kubectl --kubeconfig ${2} get nodes -o jsonpath='{range .items[*]}ip route add {.spec.podCIDR} via {.status.addresses[?(.type=="InternalIP")].address}{"\n"}')
routes=$(kubectl --kubeconfig ${2} get nodes -o jsonpath='{range .items[*]}ip route add {.spec.podCIDR} via {.status.addresses[?(.type=="InternalIP")].address}{"\n"}' | grep -v -E '^ip route add *via *$')
echo "Connecting cluster ${1} to ${2}"

IFS=$'\n'
Expand Down

0 comments on commit 6d53ae1

Please sign in to comment.