From 468182238c34e50caa94dd6f5b360769bfbc2a79 Mon Sep 17 00:00:00 2001 From: Thomas Stromberg Date: Wed, 5 Dec 2018 17:28:19 -0800 Subject: [PATCH] Revert "Use ip route commands on Linux, as they show the subnet which may be required for deletion" This reverts commit fc5256b21e656ec7df21df99f7ccabbdd5b7e9f5. --- .../minikube-iso/configs/minikube_defconfig | 1 - hack/jenkins/common.sh | 22 +++++++++---------- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/deploy/iso/minikube-iso/configs/minikube_defconfig b/deploy/iso/minikube-iso/configs/minikube_defconfig index c70b9fec76..8a6f8363ca 100644 --- a/deploy/iso/minikube-iso/configs/minikube_defconfig +++ b/deploy/iso/minikube-iso/configs/minikube_defconfig @@ -53,7 +53,6 @@ BR2_PACKAGE_SYSTEMD_LOGIND=y BR2_PACKAGE_SYSTEMD_MACHINED=y BR2_PACKAGE_SYSTEMD_VCONSOLE=y BR2_PACKAGE_UTIL_LINUX_NSENTER=y -BR2_PACKAGE_UTIL_LINUX_SCHEDUTILS=y BR2_TARGET_ROOTFS_CPIO_BZIP2=y BR2_TARGET_ROOTFS_ISO9660=y BR2_TARGET_ROOTFS_ISO9660_BOOT_MENU="$(BR2_EXTERNAL_MINIKUBE_PATH)/board/coreos/minikube/isolinux.cfg" diff --git a/hack/jenkins/common.sh b/hack/jenkins/common.sh index d198318ad2..eef2e75554 100755 --- a/hack/jenkins/common.sh +++ b/hack/jenkins/common.sh @@ -162,19 +162,17 @@ if pgrep kubectl; then fi function cleanup_stale_routes() { - local show="netstat -rn -f inet" - local del="sudo route -n delete" - - if [[ "$(uname)" == "Linux" ]]; then - show="ip route show" - del="sudo ip route delete" + stale_routes=$(netstat -rn -f inet | awk '{ print $1 }' | grep 10.96.0.0 || true) + if [[ "${stale_routes}" != "" ]]; then + echo "WARNING: deleting stale tunnel routes: ${stale_routes}" + for route in ${stale_routes}; do + if [[ "$(uname)" == "Linux" ]]; then + sudo ip route delete "${route}" || true + else + sudo route -n delete "${route}" || true + fi + done fi - - local troutes=$($show | awk '{ print $1 }' | grep 10.96.0.0 || true) - for route in ${troutes}; do - echo "WARNING: deleting stale tunnel route: ${route}" - $del "${route}" || true - done } cleanup_stale_routes || true