From 6d53ae1cd01ffadd539a1e3ee418872068a13006 Mon Sep 17 00:00:00 2001 From: Bingshen Wang Date: Tue, 26 Oct 2021 10:17:07 +0800 Subject: [PATCH] fix add empty route error fix #3 --- scripts/up.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/up.sh b/scripts/up.sh index b30de12..7dc8eaf 100755 --- a/scripts/up.sh +++ b/scripts/up.sh @@ -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'