scripts: ignore download_hash download failures (#10998)

* scripts: ignore download_hash download failures

Binary names on github releases often change and this script might break
because of that, this commit allow to ignore these failures as a mean to
be able to run the script anyway.

Signed-off-by: Arthur Outhenin-Chalandre <arthur@cri.epita.fr>

* scripts: use sha256sums for crio as well

Signed-off-by: Arthur Outhenin-Chalandre <arthur@cri.epita.fr>

* scripts: add ppc64le support for crio

Signed-off-by: Arthur Outhenin-Chalandre <arthur@cri.epita.fr>

---------

Signed-off-by: Arthur Outhenin-Chalandre <arthur@cri.epita.fr>
pull/10999/head
Arthur Outhenin-Chalandre 2024-03-11 17:36:56 +01:00 committed by GitHub
parent 43c1e3b15e
commit 26af6c7fda
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 2 deletions

View File

@ -127,7 +127,7 @@ function get_checksums() {
local binary="$1"
local version_exceptions="cri_dockerd_archive nerdctl_archive containerd_archive youki"
declare -A skip_archs=(
["crio_archive"]="arm ppc64le"
["crio_archive"]="arm"
["calicoctl_binary"]="arm"
["ciliumcli_binary"]="arm ppc64le"
["etcd_binary"]="arm"
@ -261,7 +261,7 @@ function _get_checksum() {
# Download URLs
declare -A urls=(
["crictl"]="$(printf "$github_releases_url" "kubernetes-sigs/cri-tools" "crictl-$version-$os-$arch.tar.gz.sha256")"
["crio_archive"]="$google_url/cri-o/artifacts/cri-o.$arch.$version.tar.gz"
["crio_archive"]="$google_url/cri-o/artifacts/cri-o.$arch.$version.tar.gz.sha256sum"
["kubelet"]="$(printf "$k8s_url" "kubelet")"
["kubectl"]="$(printf "$k8s_url" "kubectl")"
["kubeadm"]="$(printf "$k8s_url" "kubeadm")"
@ -287,6 +287,11 @@ function _get_checksum() {
mkdir -p "$(dirname $target)"
[ -f "$target" ] || curl -LfSs -o "${target}" "${urls[$binary]}"
if [ ! -f "$target" ]; then
echo "$target can't be downloaded" >&2
echo 0
return
fi
if echo "${urls[$binary]}" | grep -qi sha256sum; then
local hashes="$(cat "${target}")"
if [ "$(echo "${hashes}" | wc -l)" -gt 1 ]; then