Detect CNI installtion in local-up-cluster.sh

Signed-off-by: Aditi Sharma <adi.sky17@gmail.com>
This commit is contained in:
Aditi Sharma 2022-02-23 15:33:56 +05:30
parent 296bf4f016
commit 2e7b7832f8

View File

@ -1096,6 +1096,14 @@ function install_cni {
EOF 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 we are running in the CI, we need a few more things before we can start
if [[ "${KUBETEST_IN_DOCKER:-}" == "true" ]]; then if [[ "${KUBETEST_IN_DOCKER:-}" == "true" ]]; then
echo "Preparing to test ..." echo "Preparing to test ..."
@ -1166,6 +1174,7 @@ if [[ "${START_MODE}" != "kubeletonly" ]]; then
fi fi
if [[ "${START_MODE}" != "nokubelet" ]]; then if [[ "${START_MODE}" != "nokubelet" ]]; then
install_cni_if_needed
## TODO remove this check if/when kubelet is supported on darwin ## TODO remove this check if/when kubelet is supported on darwin
# Detect the OS name/arch and display appropriate error. # Detect the OS name/arch and display appropriate error.
case "$(uname -s)" in case "$(uname -s)" in