diff --git a/hack/jenkins/installers/check_install_cni_plugins.sh b/hack/jenkins/installers/check_install_cni_plugins.sh new file mode 100755 index 0000000000..da5c1550b6 --- /dev/null +++ b/hack/jenkins/installers/check_install_cni_plugins.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +# Copyright 2023 The Kubernetes Authors All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eux -o pipefail + +CNI_PLUGIN_VERSION="v1.2.0" +CNI_PLUGIN_TAR="cni-plugins-linux-amd64-$CNI_PLUGIN_VERSION.tgz" +CNI_PLUGIN_INSTALL_DIR="/opt/cni/bin" + +curl -qL -O "https://github.com/containernetworking/plugins/releases/download/$CNI_PLUGIN_VERSION/$CNI_PLUGIN_TAR" +sudo rm -rf "$CNI_PLUGIN_INSTALL_DIR" +sudo mkdir -p "$CNI_PLUGIN_INSTALL_DIR" +sudo tar -xf "$CNI_PLUGIN_TAR" -C "$CNI_PLUGIN_INSTALL_DIR" +rm "$CNI_PLUGIN_TAR" diff --git a/hack/jenkins/linux_integration_tests_none.sh b/hack/jenkins/linux_integration_tests_none.sh index 9bce63c99b..7d71ad4ccc 100755 --- a/hack/jenkins/linux_integration_tests_none.sh +++ b/hack/jenkins/linux_integration_tests_none.sh @@ -69,7 +69,7 @@ if ! which socat &>/dev/null; then sudo apt-get -qq -y install socat fi -# cri-dockerd is required for Kubernetes 1.24 and higher for none driver +# cri-dockerd is required for Kubernetes v1.24+ with none driver if ! cri-dockerd --version &>/dev/null; then echo "WARNING: cri-dockerd is not installed. will try to install." CRI_DOCKERD_VERSION="v0.3.1" @@ -81,7 +81,7 @@ if ! cri-dockerd --version &>/dev/null; then sudo chmod +x /usr/bin/cri-dockerd fi -# crictl is required for Kubernetes 1.24 and higher for none driver +# crictl is required for Kubernetes v1.24+ with none driver if ! crictl &>/dev/null; then echo "WARNING: crictl is not installed. will try to install." CRICTL_VERSION="v1.17.0" @@ -89,6 +89,9 @@ if ! crictl &>/dev/null; then sudo tar zxvf crictl-$CRICTL_VERSION-linux-amd64.tar.gz -C /usr/local/bin fi +# cni-plugins is required for Kubernetes v1.24+ with none driver +./installers/check_install_cni_plugins.sh + # We need this for reasons now sudo sysctl fs.protected_regular=0