Merge pull request #16380 from spowelljr/installPlugins

CI: install cni-plugins for none driver tests
pull/16346/head
Steven Powell 2023-04-25 19:48:44 -07:00 committed by GitHub
commit 768e62db1b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 32 additions and 2 deletions

View File

@ -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"

View File

@ -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