Skip to content

Commit e13363e

Browse files
authored
cks: fix CNI release url returning 404 (#4684)
CNI plugin release naming has changed, https://github.com/containernetworking/plugins/releases Release are named for host OS from 0.8.0 onwards. This change adds check for 404 response code and attempts retry Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
1 parent 6f361c3 commit e13363e

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

scripts/util/create-kubernetes-binaries-iso.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,10 @@ CNI_VERSION="v${3}"
3737
echo "Downloading CNI ${CNI_VERSION}..."
3838
cni_dir="${working_dir}/cni/"
3939
mkdir -p "${cni_dir}"
40-
curl -L "https://github.com/containernetworking/plugins/releases/download/${CNI_VERSION}/cni-plugins-amd64-${CNI_VERSION}.tgz" -o "${cni_dir}/cni-plugins-amd64.tgz"
40+
cni_status_code=$(curl -L --write-out "%{http_code}\n" "https://github.com/containernetworking/plugins/releases/download/${CNI_VERSION}/cni-plugins-linux-amd64-${CNI_VERSION}.tgz" -o "${cni_dir}/cni-plugins-amd64.tgz")
41+
if [[ ${cni_status_code} -eq 404 ]] ; then
42+
curl -L --write-out "%{http_code}\n" "https://github.com/containernetworking/plugins/releases/download/${CNI_VERSION}/cni-plugins-amd64-${CNI_VERSION}.tgz" -o "${cni_dir}/cni-plugins-amd64.tgz"
43+
fi
4144

4245
CRICTL_VERSION="v${4}"
4346
echo "Downloading CRI tools ${CRICTL_VERSION}..."

0 commit comments

Comments
 (0)