Update cni-plugins to v1.4.0

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
This commit is contained in:
Sascha Grunert
2023-12-05 08:52:49 +01:00
parent 55f2bc1043
commit 1ae5594fb2
5 changed files with 25 additions and 24 deletions

View File

@@ -52,7 +52,7 @@ LIMITED_SWAP=${LIMITED_SWAP:-""}
# required for cni installation
CNI_CONFIG_DIR=${CNI_CONFIG_DIR:-/etc/cni/net.d}
CNI_PLUGINS_VERSION=${CNI_PLUGINS_VERSION:-"v1.3.0"}
CNI_PLUGINS_VERSION=${CNI_PLUGINS_VERSION:-"v1.4.0"}
# The arch of the CNI binary, if not set, will be fetched based on the value of `uname -m`
CNI_TARGETARCH=${CNI_TARGETARCH:-""}
CNI_PLUGINS_URL="https://github.com/containernetworking/plugins/releases/download"
@@ -1178,25 +1178,26 @@ function install_cni {
host_arch=$(detect_arch)
fi
cni_plugin_sha=CNI_PLUGINS_${host_arch^^}_SHA256SUM
cni_plugin_tarball="${CNI_PLUGINS_VERSION}/cni-plugins-linux-${host_arch}-${CNI_PLUGINS_VERSION}.tgz"
cni_plugins_url="${CNI_PLUGINS_URL}/${cni_plugin_tarball}"
cni_plugin_tarball="cni-plugins-linux-${host_arch}-${CNI_PLUGINS_VERSION}.tgz"
cni_plugins_url="${CNI_PLUGINS_URL}/${CNI_PLUGINS_VERSION}/${cni_plugin_tarball}"
cni_plugin_sha_url="${cni_plugins_url}.sha256"
echo "Installing CNI plugin binaries ..." \
&& curl -sSL --retry 5 --output "${TMP_DIR}"/cni."${host_arch}".tgz "${cni_plugins_url}" \
&& echo "${!cni_plugin_sha} ${TMP_DIR}/cni.${host_arch}.tgz" | tee "${TMP_DIR}"/cni.sha256 \
&& sha256sum --ignore-missing -c "${TMP_DIR}"/cni.sha256 \
&& rm -f "${TMP_DIR}"/cni.sha256 \
&& sudo mkdir -p /opt/cni/bin \
&& sudo tar -C /opt/cni/bin -xzvf "${TMP_DIR}"/cni."${host_arch}".tgz \
&& rm -rf "${TMP_DIR}"/cni."${host_arch}".tgz \
&& sudo find /opt/cni/bin -type f -not \( \
-iname host-local \
-o -iname bridge \
-o -iname portmap \
-o -iname loopback \
\) \
-delete
echo "Installing CNI plugin binaries ..." &&
cd "${TMP_DIR}" &&
curl -sSL --retry 5 -o "${cni_plugin_tarball}" "${cni_plugins_url}" &&
curl -sSL --retry 5 -o "${cni_plugin_tarball}.sha256" "${cni_plugin_sha_url}" &&
sha256sum -c "${cni_plugin_tarball}.sha256" &&
rm -f "${cni_plugin_tarball}.sha256" &&
sudo mkdir -p /opt/cni/bin &&
sudo tar -C /opt/cni/bin -xzvf "${cni_plugin_tarball}" &&
rm -rf "${cni_plugin_tarball}" &&
sudo find /opt/cni/bin -type f -not \( \
-iname host-local \
-o -iname bridge \
-o -iname portmap \
-o -iname loopback \
\) \
-delete
# containerd 1.4.12 installed by docker in kubekins supports CNI version 0.4.0
echo "Configuring cni"