From 2e7b7832f8db3803b0e6a8186cde1322978bbbbc Mon Sep 17 00:00:00 2001 From: Aditi Sharma Date: Wed, 23 Feb 2022 15:33:56 +0530 Subject: [PATCH] Detect CNI installtion in local-up-cluster.sh Signed-off-by: Aditi Sharma --- hack/local-up-cluster.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/hack/local-up-cluster.sh b/hack/local-up-cluster.sh index d5e187bd0fc..31e14a24890 100755 --- a/hack/local-up-cluster.sh +++ b/hack/local-up-cluster.sh @@ -1096,6 +1096,14 @@ function install_cni { EOF } +function install_cni_if_needed { + echo "Checking CNI Installation at /opt/cni/bin" + if ! command -v /opt/cni/bin/loopback &> /dev/null ; then + echo "CNI Installation not found at /opt/cni/bin" + install_cni + fi +} + # If we are running in the CI, we need a few more things before we can start if [[ "${KUBETEST_IN_DOCKER:-}" == "true" ]]; then echo "Preparing to test ..." @@ -1166,6 +1174,7 @@ if [[ "${START_MODE}" != "kubeletonly" ]]; then fi if [[ "${START_MODE}" != "nokubelet" ]]; then + install_cni_if_needed ## TODO remove this check if/when kubelet is supported on darwin # Detect the OS name/arch and display appropriate error. case "$(uname -s)" in